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Uw7CisgICB9CisKKyAgIC8qCisgICAgKiBJbml0aWFsaXplIE1JSQorICAgICovCisgICBpZiAoIGl4RXRoQWNjTWlpSW5pdCgpICE9IElYX0VUSF9BQ0NfU1VDQ0VTUyApCisgICB7CisgICAgICBJWF9FVEhfQUNDX1dBUk5JTkdfTE9HKCJpeEV0aEFjY0luaXQ6IE1paSBpbml0IGZhaWxlZFxuIiwgMCwgMCwgMCwgMCwgMCwgMCk7CisKKyAgICAgICByZXR1cm4gSVhfRVRIX0FDQ19GQUlMOworICAgfQorCisgICAvKgorICAgICogSW5pdGlhbGl6ZSBNQUMgSS9PIG1lbW9yeQorICAgICovCisgICBpZiAoaXhFdGhBY2NNYWNNZW1Jbml0KCkgIT0gSVhfRVRIX0FDQ19TVUNDRVNTKQorICAgeworICAgICAgSVhfRVRIX0FDQ19XQVJOSU5HX0xPRygiaXhFdGhBY2NJbml0OiBNYWMgaW5pdCBmYWlsZWRcbiIsIDAsIDAsIDAsIDAsIDAsIDApOworCisgICAgIHJldHVybiBJWF9FVEhfQUNDX0ZBSUw7CisgICB9CisKKyAgIC8qCisgICAgKiBJbml0aWFsaXplIGNvbnRyb2wgcGxhbmUgaW50ZXJmYWNlIGxvY2sKKyAgICAqLworICAgaWYgKGl4T3NhbE11dGV4SW5pdCgmaXhFdGhBY2NDb250cm9sSW50ZXJmYWNlTXV0ZXgpICE9IElYX1NVQ0NFU1MpCisgICB7CisgICAgICAgSVhfRVRIX0FDQ19XQVJOSU5HX0xPRygiaXhFdGhBY2NJbml0OiBDb250cm9sIHBsYW5lIGludGVyZmFjZSBsb2NrIGluaXRpYWxpemF0aW9uIGZhaWxlZFxuIiwgMCwgMCwgMCwgMCwgMCwgMCk7CisKKyAgICAgICByZXR1cm4gSVhfRVRIX0FDQ19GQUlMOworICAgfQorCisgICAvKiBpbml0aWFsaWFzYXRpb24gaXMgY29tcGxldGUgKi8KKyAgIGl4RXRoQWNjU2VydmljZUluaXQgPSBUUlVFOworCisgICByZXR1cm4g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gICAoY2hhciAqKSBOVUxMLAorICAgICAoSXhRTWdyQ2FsbGJhY2spIE5VTEwsCisgICAgIChJeFFNZ3JDYWxsYmFja0lkKSAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwCisgIH0KKworfTsKKworLyoqCisgKgorICogQGJyaWVmIERhdGEgc3RydWN0dXJlIHVzZWQgdG8gcmVnaXN0ZXIgJiBpbml0aWFsaXplIHRoZSBRdWV1ZXMKKyAqCisgKiBUaGUgc3RydWN0dXJlIHdpbGwgYmUgZmlsbGVkIGF0IHJ1biB0aW1lIGRlcGVuZGluZyBvbiB0aGUgTlBFCisgKiBpbWFnZSBhbHJlYWR5IGxvYWRlZCBhbmQgdGhlIFFvUyBjb25maWd1cmVkIGluIGV0aERCLgorICoKKyAqLworSVhfRVRIX0FDQ19QUklWQVRFCitJeEV0aEFjY1FyZWdJbmZvIGl4RXRoQWNjUW1nclJ4UXVldWVzSW5mb1tJWF9FVEhBQ0NfTUFYX1JYX1FVRVVFUysxXT0KK3sKKyAgeyAgLyogUGxhY2VIb2xkZXIgZm9yIHJ4IHF1ZXVlcworICAgICAgKiBkZXBlbmRpbmcgb24gdGhlIFFvUyBjb25maWd1cmVkCisgICAgICAqLworICAgICAoSXhRTWdyUUlkKTAsCisgICAgIChjaGFyICopIE5VTEwsCisgICAgIChJeFFNZ3JDYWxsYmFjaykgTlVMTCwKKyAgICAgKEl4UU1nckNhbGxiYWNrSWQpIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAKKyAgfSwKKworICB7ICAvKiBQbGFjZUhvbGRlciBmb3IgcnggcXVldWVzCisgICAgICAqIGRlcGVuZGluZyBvbiB0aGUgUW9TIGNvbmZpZ3VyZWQKKyAgICAgICovCisgICAgIChJeFFNZ3JRSWQpMCwKKyAgICAgKGNoYXIgKikgTlVMTCwKKyAgICAgKEl4UU1nckNhbGxiYWNrKSBOVUxMLAorICAgICAoSXhRTWdyQ2FsbGJhY2tJZCkgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMAorICB9LAorCisgIHsgIC8qIFBsYWNlSG9sZGVyIGZvciByeCBxdWV1ZXMKKyAgICAgICogZGVwZW5kaW5nIG9uIHRoZSBRb1MgY29uZmlndXJlZAorICAgICAgKi8KKyAgICAgKEl4UU1nclFJZCkwLAorICAgICAoY2hhciAqKSBOVUxMLAorICAgICAoSXhRTWdyQ2FsbGJhY2spIE5VTEwsCisgICAgIChJeFFNZ3JDYWxsYmFja0lkKSAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwCisgIH0sCisKKyAgeyAgLyogUGxhY2VIb2xkZXIgZm9yIHJ4IHF1ZXVlcworICAgICAgKiBkZXBlbmRpbmcgb24gdGhlIFFvUyBjb25maWd1cmVkCisgICAgICAqLworICAgICAoSXhRTWdyUUlkKTAsCisgICAgIChjaGFyICopIE5VTEwsCisgICAgIChJeFFNZ3JDYWxsYmFjaykgTlVMTCwKKyAgICAgKEl4UU1nckNhbGxiYWNrSWQpIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAKKyAgfSwKKworICB7ICAvKiBQbGFjZUhvbGRlciBmb3IgcnggcXVldWVzCisgICAgICAqIGRlcGVuZGluZyBvbiB0aGUgUW9TIGNvbmZpZ3VyZWQKKyAgICAgICovCisgICAgIChJeFFNZ3JRSWQpMCwKKyAgICAgKGNoYXIgKikgTlVMTCwKKyAgICAgKEl4UU1nckNhbGxiYWNrKSBOVUxMLAorICAgICAoSXhRTWdyQ2FsbGJhY2tJZCkgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMAorICB9LAorCisgIHsgIC8qIFBsYWNlSG9sZGVyIGZvciByeCBxdWV1ZXMKKyAgICAgICogZGVwZW5kaW5nIG9uIHRoZSBRb1MgY29uZmlndXJlZAorICAgICAgKi8KKyAgICAgIChJeFFNZ3JRSWQpMCwKKyAgICAgKGNoYXIgKikgTlVMTCwKKyAgICAgKEl4UU1nckNhbGxiYWNrKSBOVUxMLAorICAgICAoSXhRTWdyQ2FsbGJhY2tJZCkgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMCwKKyAgICAgMAorICB9LAorCisgIHsgIC8qIFBsYWNlSG9sZGVyIGZvciByeCBxdWV1ZXMKKyAgICAgICogZGVwZW5kaW5nIG9uIHRoZSBRb1MgY29uZmlndXJlZAorICAgICAgKi8KKyAgICAgKEl4UU1nclFJZCkwLAorICAgICAoY2hhciAqKSBOVUxMLAorICAgICAoSXhRTWdyQ2FsbGJhY2spIE5VTEwsCisgICAgIChJeFFNZ3JDYWxsYmFja0lkKSAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwLAorICAgICAwCisgIH0sCisKKyAgeyAgLyogUGxhY2VIb2xkZXIgZm9yIHJ4IHF1ZXVlcworICAgICAgKiBkZXBlbmRpbmcgb24gdGhlIFFvUyBjb25maWd1cmVkCisgICAgICAqLworICAgICAoSXhRTWdyUUlkKTAsCisgICAgIChjaGFyICopIE5VTEwsCisgICAgIChJeFFNZ3JDYWxsYmFjaykgTlVMTCwKKyAgICAgKEl4UU1nckNhbGxiYWNrSWQpIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAsCisgICAgIDAKKyAgfSwKKworICB7ICAvKiBOdWxsIFRlcm1pbmF0aW9uIGVudHJ5CisgICAgICAqLworICAgICAoSXhRTWdyUUlkKTAsCisgICAgIChjaGFyICopIE5VTEwsCisgICAgIChJeFFNZ3JDYWxsYmFjaykgTlVMTCwKKyAgICAgKEl4UU1nckNhbGxiYWNrSWQpIDAsCisgICAgIDAsCisgICAgIDAs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cmV0dXJuIElYX0VUSF9BQ0NfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKChJWF9FVEhfUE9SVF8zID09IHBvcnRJZCkgJiYKKyAgICAgICAgICAgICAgICAoaXhGZWF0dXJlQ3RybENvbXBvbmVudENoZWNrKElYX0ZFQVRVUkVDVFJMX05QRUFfRVRIKSA9PQorICAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0VOQUJMRUQpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJldHVybiBJWF9FVEhfQUNDX1NVQ0NFU1M7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiBJWF9FVEhfQUNDX0ZBSUw7CisgICAgICB9CisKKyAgICByZXR1cm4gSVhfRVRIX0FDQ19TVUNDRVNTOworfQorCisvKioKKyAqIEBmbiBpeEV0aEFjY1N0YXRzU2hvdyh2b2lkKQorICoKKyAqIEBicmllZiBEaXNwbGF5cyBhbGwgRXRoQWNjIHN0YXRzCisgKgorICogQHJldHVybiB2b2lkCisgKgorICovCit2b2lkIGl4RXRoQWNjU3RhdHNTaG93KEl4RXRoQWNjUG9ydElkIHBvcnRJZCkKK3sKKyAgICBpeEV0aEFjY01kaW9TaG93KCk7CisKKyAgICBwcmludGYoIlxuUG9ydCAldVxuVW5pY2FzdCBNQUMgOiAiLCBwb3J0SWQpOworICAgIGl4RXRoQWNjUG9ydFVuaWNhc3RBZGRyZXNzU2hvdyhwb3J0SWQpOworICAgIGl4RXRoQWNjUG9ydE11bHRpY2FzdEFkZHJlc3NTaG93KHBvcnRJZCk7CisgICAgcHJpbnRmKCJcbiIpOworCisgICAgaXhFdGhBY2NEYXRhUGxhbmVTaG93KCk7Cit9CisKKworCmRpZmYgLS1naXQgYS9jcHUvaXhwL25wZS9JeEV0aEFjY0NvbnRyb2xJbnRlcmZhY2UuYyBiL2NwdS9peHAvbnBlL0l4RXRoQWNjQ29udHJvbEludG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fTURBVEEobWJ1ZlB0cikpICkKKyAgICAgICAgeworICAgICAgICAgICAgLyogc2V0IHRvIG1pbmltdW0gbGVuZ3RoICovCisgICAgICAgICAgICBJWF9PU0FMX01CVUZfTUxFTihtYnVmUHRyKSA9IElYX09TQUxfTUJVRl9QS1RfTEVOKG1idWZQdHIpID0KKyAgICAgICAgICAgICAgICBJWF9FVEhOUEVfQUNDX1JYRlJFRV9CVUZGRVJfTEVOR1RIX01JTjsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIHJlc3RvcmUgb3JpZ2luYWwgbGVuZ3RoICovCisgICAgICAgICAgICBJWF9PU0FMX01CVUZfTUxFTihtYnVmUHRyKSA9IElYX09TQUxfTUJVRl9QS1RfTEVOKG1idWZQdHIpID0KKyAgICAgICAgICAgICAgICAoIElYX09TQUxfTUJVRl9BTExPQ0FURURfQlVGRl9MRU4obWJ1ZlB0cikgLQorICAgICAgICAgICAgICAgICAoSVhfT1NBTF9NQlVGX01EQVRBKG1idWZQdHIpIC0gKFVJTlQ4ICopSVhfT1NBTF9NQlVGX0FMTE9DQVRFRF9CVUZGX0RBVEEobWJ1ZlB0cikpICk7CisgICAgICAgIH0KKworICAgICAgICAvKiByZXBsZW5pc2ggZnJvbSBoZXJlICovCisgICAgICAgIGlmIChpeEV0aEFjY1BvcnRSeEZyZWVSZXBsZW5pc2gocG9ydElkLCBtYnVmUHRyKSAhPSBJWF9FVEhfQUNDX1NVQ0NFU1MpCisgICAgICAgIHsKKyAgICAgICAgICAgICAgICBJWF9FVEhfQUNDX0ZBVEFMX0xPRygiaXhFdGhSeEZyYW1lUHJvY2VzczogRmFpbGVkIHRvIHJlcGxlbmlzaCB3aXRoIGZpbHRlcmVkIGZyYW1lXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbiBwb3J0ICVkXG4iLCBwb3J0SWQsIDAsIDAsIDAsIDAsIDApOworICAgICAgICB9CisKKyAgICAg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gPT0gcG9ydElkKSAmJgorICAgICAgICAgICAgICAgICAgICAoaXhGZWF0dXJlQ3RybENvbXBvbmVudENoZWNrKElYX0ZFQVRVUkVDVFJMX0VUSDEpID09CisgICAgICAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0RJU0FCTEVEKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlIDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKChJWF9FVEhfUE9SVF8zID09IHBvcnRJZCkgJiYKKyAgICAgICAgICAgICAgICAgICAgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9OUEVBX0VUSCkgPT0KKyAgICAgICAgICAgICAgICAgICAgIElYX0ZFQVRVUkVfQ1RSTF9DT01QT05FTlRfRElTQUJMRUQpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWUgOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisJcHJpbnRmKCJQT1JUICV1IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG4iLAorCSAgICAgICBwb3J0SWQpOworI2lmbmRlZiBOREVCVUcKKwlwcmludGYoIlR4IERvbmUgRnJhbWVzICAgICAgICAgICAgICAgIDogJXVcbiIsCisJICAgICAgIHR4W3BvcnRJZF0udHhEb25lQ2xpZW50Q2FsbGJhY2sgKworCSAgICAgICB0eFtwb3J0SWRdLnR4RG9uZVN3UUR1cmluZ0Rpc2FibGUgKworCSAgICAgICB0eFtwb3J0SWRdLnR4RG9uZUR1cmluZ0Rpc2FibGUpOworCXByaW50ZigiVHggRnJhbWVzICAgICAgICAgICAgICAgICAgICAgOiAldVxuIiwKKwkgICAgICAgdHhbcG9ydElkXS50eFFPSyArIHR4W3BvcnRJZF0udHhRRGVsYXllZCk7CisJcHJpbnRmKCJUeCBIL1cgUSBBZGRlZCBPSyAgICAgICAgICAgICA6ICV1XG4iLAorCSAgICAgICB0eFtwb3J0SWRdLnR4UU9LKTsKKwlwcmludGYoIlR4IEgvVyBRIERlbGF5ZWQgICAgICAgICAgICAgIDogJXVcbiIsCisJICAgICAgIHR4W3BvcnRJZF0udHhRRGVsYXllZCk7CisJcHJpbnRmKCJUeCBGcm9tIFMvVyBRIEFkZGVkIE9LICAgICAgICA6ICV1XG4iLAorCSAgICAgICB0eFtwb3J0SWRdLnR4RnJvbVN3UU9LKTsKKwlwcmludGYoIlR4IEZyb20gUy9XIFEgRGVsYXllZCAgICAgICAgIDogJXVcbiIsCisJICAgICAgIHR4W3BvcnRJZF0udHhGcm9tU3dRRGVsYXllZCk7CisJcHJpbnRmKCJUeCBPdmVyZmxvdyAgICAgICAgICAgICAgICAgICA6ICV1XG4iLAorCSAgICAgICB0eFtwb3J0SWRdLnR4T3ZlcmZsb3cpOworCXByaW50ZigiVHggTXV0dWFsIExvY2sgICAgICAgICAgICAgICAgOiAldVxuIiwKKwkgICAgICAgdHhbcG9ydElkXS50eExvY2spOworCXByaW50ZigiVHggTGF0ZSBOdGYgRW5hYmxlZCAgICAgICAgICAgOiAldVxuIiwKKwkgICAgICAgdHhbcG9ydElkXS50eExhdGVOb3RpZmljYXRpb25FbmFibGVkKTsKKwlwcmludGYoIlR4IExvdyBUaHJlc2ggQ0IgICAgICAgICAgICAgIDogJXVcbiIsCisJICAgICAgIHR4W3BvcnRJZF0udHhMb3dUaHJlc2hDYWxsYmFjayk7CisJcHJpbnRmKCJUeCBEb25lIGZyb20gSC9XIFEgKERpc2FibGUpICA6ICV1XG4iLAorCSAgICAgICB0eFtwb3J0SWRdLnR4RG9uZUR1cmluZ0Rpc2FibGUpOworCXByaW50ZigiVHggRG9uZSBmcm9tIFMvVyBRIChEaXNhYmxlKSAgOiAldVxuIiwKKwkgICAgICAgdHhbcG9ydElkXS50eERvbmVTd1FEdXJpbmdEaXNhYmxlKTsKKwlmb3IgKHByaW9yaXR5ID0gSVhfRVRIX0FDQ19UWF9QUklPUklUWV8wOworCSAgICAgcHJpb3JpdHkgPD0gSVhfRVRIX0FDQ19UWF9QUklPUklUWV83OworCSAgICAgcHJpb3JpdHkrKykKKwl7CisJICAgIGlmICh0eFtwb3J0SWRdLnR4UHJpb3JpdHlbcHJpb3JpdHldKQorCSAgICB7CisJCXByaW50ZigiVHggUHJpb3JpdHkgJXUgICAgICAgICAgICAgICAgIDogJXVcbiIsCisJCSAgICAgICBwcmlvcml0eSwKKwkJICAgICAgIHR4W3BvcnRJZF0udHhQcmlvcml0eVtwcmlvcml0eV0pOworCSAgICB9CisJfQorI2VuZGlmCisJcHJpbnRmKCJUeCB1bmV4cGVjdGVkIGVycm9ycyAgICAgICAgICA6ICV1IChzaG91bGQgYmUgMClcbiIsCisJICAgICAgIHR4W3BvcnRJZF0udHhVbmV4cGVjdGVkRXJyb3IpOworCisjaWZuZGVmIE5ERUJVRworCXByaW50ZigiUnggRnJhbWVzICAgICAgICAgICAgICAgICAgICAgOiAldVxuIiwKKwkgICAgICAgcnhbcG9ydElkXS5yeEZyYW1lQ2xpZW50Q2FsbGJhY2sgKworCSAgICAgICByeFtwb3J0SWRdLnJ4U3dRRHVyaW5nRGlzYWJsZSsKKwkgICAgICAgcnhbcG9ydElkXS5yeER1cmluZ0Rpc2FibGUpOworCXByaW50ZigiUnggRnJlZSBSZXBsZW5pc2ggICAgICAgICAgICAgOiAldVxuIiwKKwkgICAgICAgcnhbcG9ydElkXS5yeEZyZWVSZXBPSyArIHJ4W3BvcnRJZF0ucnhGcmVlUmVwRGVsYXllZCk7CisJcHJpbnRmKCJSeCBGcmVlIEgvVyBRIEFkZGVkIE9LICAgICAgICA6ICV1XG4iLAorCSAgICAgICByeFtwb3J0SWRdLnJ4RnJlZVJlcE9LKTsKKwlwcmludGYoIlJ4IEZyZWUgSC9XIFEgRGVsYXllZCAgICAgICAgIDogJXVcbiIsCisJICAgICAgIHJ4W3BvcnRJZF0ucn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AgICBwcmludGYoIlR4IFFNIENhbGxiYWNrIGludm9rZWQgICAgICAgIDogJXVcbiIsCisJICAgdHhDYWxsYmFja0NvdW50ZXIpOworICAgIHByaW50ZigiUnggUU0gQ2FsbGJhY2sgaW52b2tlZCAgICAgICAgOiAldVxuIiwKKwkgICBzdGF0cy5yeENhbGxiYWNrQ291bnRlcik7CisgICAgcHJpbnRmKCJSeCBRTSBDYWxsYmFjayBidXJzdCByZWFkICAgICA6ICV1XG4iLAorCSAgIHN0YXRzLnJ4Q2FsbGJhY2tCdXJzdFJlYWQpOworICAgIHByaW50ZigiUnggRnJlZSBRTSBDYWxsYmFjayBpbnZva2VkICAgOiAldVxuIiwKKwkgICByeEZyZWVDYWxsYmFja0NvdW50ZXIpOworI2VuZGlmCisgICAgcHJpbnRmKCJVbmV4cGVjdGVkIGVycm9ycyBpbiBDQiAgICAgICA6ICV1IChzaG91bGQgYmUgMClcbiIsCisJICAgc3RhdHMudW5leHBlY3RlZEVycm9yKTsKKyAgICBwcmludGYoIlxuIik7CisKKyAgICBwcmludGYoIkhhcmR3YXJlIHF1ZXVlcyBsZXZlbHMgOlxuIik7CisgICAgcHJpbnRmKCJUcmFuc21pdCBQb3J0IDEgUSAgICAgICAgICAgICA6ICV1IFxuIixudW1UeDBFbnRyaWVzKTsKKyAgICBwcmludGYoIlRyYW5zbWl0IFBvcnQgMiBRICAgICAgICAgICAgIDogJXUgXG4iLG51bVR4MUVudHJpZXMpOworI2lmZGVmIF9faXhwNDZYCisgICAgcHJpbnRmKCJUcmFuc21pdCBQb3J0IDMgUSAgICAgICAgICAgICA6ICV1IFxuIixudW1UeDJFbnRyaWVzKTsKKyNlbmRpZgorICAgIHByaW50ZigiVHJhbnNtaXQgRG9uZSBRICAgICAgICAgICAgICAgOiAldSBcbiIsbnVtVHhEb25lRW50cmllcyk7CisgICAgcHJpbnRmKCJSZWNlaXZlIFEgICAgICAgICAgICAgICAgICAgICA6ICV1IFxuIixudW1SeEVudHJpZXMpOworICAg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JJeEV0aE5wZS5oIgorI2luY2x1ZGUgIkl4RXRoQWNjLmgiCisjaW5jbHVkZSAiSXhFdGhBY2NEYXRhUGxhbmVfcC5oIgorI2luY2x1ZGUgIkl4RXRoQWNjX3AuaCIKKyNpbmNsdWRlICJJeEV0aEFjY01hY19wLmgiCisKKy8qIE1heGltdW0gbnVtYmVyIG9mIHJldHJpZXMgZHVyaW5nIGl4RXRoQWNjUG9ydERpc2FibGUsIHdoaWNoCisgKiBpcyBhcHByb3hpbWF0ZWx5IDEwIHNlY29uZHMKKyovCisjZGVmaW5lIElYX0VUSF9BQ0NfTUFYX1JFVFJZIDUwMAorCisvKiBNYXhpbXVtIG51bWJlciBvZiByZXRyaWVzIGR1cmluZyBpeEV0aEFjY1BvcnREaXNhYmxlIHdoZW4gZXhwZWN0aW5nCisgKiB0aW1lb3V0CisgKi8KKyNkZWZpbmUgSVhfRVRIX0FDQ19NQVhfUkVUUllfVElNRU9VVCA1CisKKyNkZWZpbmUgSVhfRVRIX0FDQ19WQUxJREFURV9QT1JUX0lEKHBvcnRJZCkgXAorICAgIGRvICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgaWYoIUlYX0VUSF9BQ0NfSVNfUE9SVF9WQUxJRChwb3J0SWQpKSAgIFwKKyAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCSAgICByZXR1cm4gSVhfRVRIX0FDQ19JTlZBTElEX1BPUlQ7ICAgICAgICAgICAgICAgICAgICAgIFwKKyAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorICAgIH0gd2hpbGUoMCkKKworUFVCTElDIEl4RXRoQWNjTWFjU3RhdGU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paUFjY2Vzc1RpbWVvdXQpOworICAgICAgICBtaWlUaW1lb3V0LS07CisgICAgfQorICAgIAorICAgIGl4T3NhbE11dGV4VW5sb2NrKCZtaWlBY2Nlc3NMb2NrKTsKKyAgICBpZihtaWlUaW1lb3V0ID09IDApCisgICAgeworCXJldHVybiBJWF9FVEhfQUNDX0ZBSUw7CisgICAgfQorICAgIHJldHVybiBJWF9FVEhfQUNDX1NVQ0NFU1M7Cit9CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKgorICogIFBoeSBxdWVyeSBmdW5jdGlvbnMKKyAqCisgKi8KK0l4RXRoQWNjU3RhdHVzCitpeEV0aEFjY01paVN0YXRzU2hvdyAoVUlOVDMyIHBoeUFkZHIpCit7CisgICAgVUlOVDE2IHJlZ3ZhbDsKKyAgICBwcmludGYoIlJlZ2lzZXJzIG9uIFBIWSBhdCBhZGRyZXNzIDB4JXhcbiIsIHBoeUFkZHIpOworICAgIGl4RXRoQWNjTWlpUmVhZFJ0bihwaHlBZGRyLCBJWF9FVEhfQUNDX01JSV9DVFJMX1JFRywgJnJlZ3ZhbCk7CisgICAgcHJpbnRmKCIgICAgQ29udHJvbCBSZWdpc3RlciAgICAgICAgICAgICAgICAgIDogICAgICAweCU0LjR4XG4iLCByZWd2YWwpOworICAgIGl4RXRoQWNjTWlpUmVhZFJ0bihwaHlBZGRyLCAgSVhfRVRIX0FDQ19NSUlfU1RBVF9SRUcsICZyZWd2YWwpOworICAgIHByaW50ZigiICAgIFN0YXR1cyBSZWdpc3RlciAgICAgICAgICAgICAgICAgICA6ICAgICAgMHglNC40eFxuIiwgcmVndmFsKTsKKyAgICBpeEV0aEFjY01paVJlYWRSdG4ocGh5QWRkciwgIElYX0VUSF9BQ0NfTUlJX1BIWV9JRDFfUkVHLCAmcmVndmFsKTsKKyAgICBwcmludGYoIiAgICBQSFkgSUQxIFJlZ2lzdGVyICAgICAgICAgICA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BvcnRJbmRleF0uZW5hYmxlZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBJeE5wZU1oTWVzc2FnZSBtZXNzYWdlOworICAgICAgICAgICAgICAgIElYX1NUQVRVUyByZXN1bHQ7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgLyogc2VuZCBFREJfR2V0TUFDQWRkcmVzc0RhdGFiYXNlIG1lc3NhZ2UgKi8KKyAgICAgICAgICAgICAgICBGSUxMX0dFVE1BQ0FERFJFU1NEQVRBQkFTRShtZXNzYWdlLCAKKyAgICAgICAgICAgICAgICAgICAgMCAvKiB1bnVzZWQgKi8sIAorICAgICAgICAgICAgICAgICAgICBJWF9PU0FMX01NVV9WSVJUX1RPX1BIWVMoaXhFdGhEQlBvcnRJbmZvW3BvcnRJbmRleF0udXBkYXRlTWV0aG9kLm5wZVVwZGF0ZVpvbmUpKTsKKworICAgICAgICAgICAgICAgIElYX0VUSERCX1NFTkRfTlBFX01TRyhJWF9FVEhfREJfUE9SVF9JRF9UT19OUEUocG9ydEluZGV4KSwgbWVzc2FnZSwgcmVzdWx0KTsKKworICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgPT0gSVhfU1VDQ0VTUykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIC8qIGFuYWx5emUgTlBFIGNvcHkgKi8KKyAgICAgICAgICAgICAgICAgICAgaXhFdGhEQk5QRVN5bmNTY2FuKHBvcnRJbmRleCwgaXhFdGhEQlBvcnRJbmZvW3BvcnRJbmRleF0udXBkYXRlTWV0aG9kLm5wZVVwZGF0ZVpvbmUsIEZVTExfRUxUX0JZVEVfU0laRSk7CisKKyAgICAgICAgICAgICAgICAgICAgSVhfRVRIX0RCX1NVUFBPUlRfVFJBQ0UoIkRCOiAoQVBJKSBGaW5pc2hlZCBzY2FubmluZyBOUEUgdHJlZSBvbiBwb3J0ICVkXG4iLCBwb3J0SW5kZXgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpeEV0aERCUG9ydEluZm9bcG9ydEluZGV4XS5hZ2luZ0VuYWJsZWQgICAgICAgICAgICAgICAgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICAgICAgaXhFdGhEQlBvcnRJbmZvW3BvcnRJbmRleF0udXBkYXRlTWV0aG9kLnVwZGF0ZUVuYWJsZWQgID0gRkFMU0U7CisgICAgICAgICAgICAgICAgICAgIGl4RXRoREJQb3J0SW5mb1twb3J0SW5kZXhdLnVwZGF0ZU1ldGhvZC51c2VyQ29udHJvbGxlZCA9IFRSVUU7CisKKyAgICAgICAgICAgICAgICAgICAgaXhPc2FsTG9nKElYX09TQUxfTE9HX0xWTF9GQVRBTCwKKyAgICAgICAgICAgICAgICAgICAgICAgIElYX09TQUxfTE9HX0RFVl9TVERPVVQsIAorICAgICAgICAgICAgICAgICAgICAgICAgIkV0aERCOiAoTWFpbnRlbmFuY2UpIHdhcm5pbmcsIGRpc2FibGluZyBhZ2luZyBhbmQgdXBkYXRlcyBmb3IgcG9ydCAlZCAoYXNzdW1lZCBkZWFkKVxuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvcnRJbmRleCwgMCwgMCwgMCwgMCwgMCk7CisKKyAgICAgICAgICAgICAgICAgICAgaXhFdGhEQkRhdGFiYXNlQ2xlYXIocG9ydEluZGV4LCBJWF9FVEhfREJfQUxMX1JFQ09SRF9UWVBFUyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLyogYnJvd3NlIGRhdGFiYXNlIGFuZCBhZ2UgZW50cmllcyAqLworICAgICAgICBCVVNZX1JFVFJZKGl4RXRoREJJbml0SGFzaEl0ZXJhdG9yKCZkYkhhc2h0YWJsZSwgJml0ZXJhdG9yKSk7CisKKyAgICAgICAgd2hpbGUgKElTX0lURVJBVE9SX1ZBTElEKCZpdGVyYXRvcikpCisgICAgICAgIHsKKyAgICAgICAgICAgIE1hY0Rlc2NyaXB0b3IgKmRlc2NyaXB0b3IgPSAoTWFjRGVzY3JpcHRvciAqKSBpdGVyYXRvci5ub2RlLT5kYXRhOworICAgICAgICAgICAgVUlOVDMyICphZ2UgICAgICAgICAgICAgICA9IE5VTEw7CisgICAgICAgICAgICBCT09MIHN0YXRpY0VudHJ5ICAgICAgICAgID0gVFJVRTsKKworICAgICAgICAgICAgaWYgKGRlc2NyaXB0b3ItPnR5cGUgPT0gSVhfRVRIX0RCX0ZJTFRFUklOR19SRUNPUkQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgYWdlICAgICAgICAgPSAmZGVzY3JpcHRvci0+cmVjb3JkRGF0YS5maWx0ZXJpbmdEYXRhLmFnZTsKKyAgICAgICAgICAgICAgICBzdGF0aWNFbnRyeSA9IGRlc2NyaXB0b3ItPnJlY29yZERhdGEuZmlsdGVyaW5nRGF0YS5zdGF0aWNFbnRyeTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UgaWYgKGRlc2NyaXB0b3ItPnR5cGUgPT0gSVhfRVRIX0RCX0ZJTFRFUklOR19WTEFOX1JFQ09SRCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBhZ2UgICAgICAgICA9ICZkZXNjcmlwdG9yLT5yZWNvcmREYXRhLmZpbHRlcmluZ1ZsYW5EYXRhLmFnZTsKKyAgICAgICAgICAgICAgICBzdGF0aWNFbnRyeSA9IGRlc2NyaXB0b3ItPnJlY29yZERhdGEuZmlsdGVyaW5nVmxhbkRhdGEuc3RhdGljRW50cnk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RhdGljRW50cnkgPSBUUlVFOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoaXhFdGhEQlBvcnRJbmZvW2Rlc2NyaXB0b3ItPnBvcnRJRF0uYWdpbmdFbmFibGVkICYmIChzdGF0aWNFbnRyeSA9PSBGQUxTRSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogbWFudWFsbHkgaW5jcmVtZW50IHRoZSBhZ2UgaWYgdGhlIHBvcnQgaGFzIG5vIHN1Y2ggY2FwYWJpbGl0eSAqLworICAgICAgICAgICAgICAgIGlmICgoaXhFdGhEQlBvcnREZWZpbml0aW9uc1tkZXNjcmlwdG9yLT5wb3J0SURdLmNhcGFiaWxpdGllcyAmIElYX0VUSF9FTlRSWV9BR0lORykgPT0gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICphZ2UgKz0gKElYX0VUSF9EQl9NQUlOVEVOQU5DRV9USU1FIC8gNjApOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8qIGFnZSBlbnRyeSBpZiBpdCBleGNlZWRlZCB0aGUgbWF4aW11bSB0aW1lIHRvIGxpdmUgKi8KKyAgICAgICAgICAgICAgICBpZiAoKmFnZSA+PSAoSVhfRVRIX0RCX0xFQVJOSU5HX0VOVFJZX0FHRV9USU1FIC8gNjApKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogYWRkIHBvcnQgdG8gdGhlIHNldCBvZiB1cGRhdGUgdHJpZ2dlciBwb3J0cyAqLworICAgICAgICAgICAgICAgICAgICBKT0lOX1BPUlRfVE9fTUFQKHRyaWdnZXJQb3J0cywgZGVzY3JpcHRvci0+cG9ydElEKTsKKworICAgICAgICAgICAgICAgICAgICAvKiBkZWxldGUgZW50cnkgKi8KKyAgICAgICAgICAgICAgICAgICAgQlVTWV9SRVRSWShpeEV0aERCUmVtb3ZlRW50cnlBdEhhc2hJdGVyYXRvcigmZGJIYXNodGFibGUsICZpdGVyYXRvcikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBtb3ZlIHRvIHRoZSBuZXh0IHJlY29yZCAqLworICAgICAgICAgICAgICAgICAgICBCVVNZX1JFVFJZKGl4RXRoREJJbmNyZW1lbnRIYXNoSXRlcmF0b3IoJmRiSGFzaHRhYmxlLCAmaXRlcmF0b3IpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogbW92ZSB0byB0aGUgbmV4dCByZWNvcmQgKi8KKyAgICAgICAgICAgICAgICBCVVNZX1JFVFJZKGl4RXRoREJJbmNyZW1lbnRIYXNoSXRlcmF0b3IoJmRiSGFzaHRhYmxlLCAmaXRlcmF0b3IpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8qIHVwZGF0ZSBwb3J0cyB3aGljaCBsb3N0IHJlY29yZHMgKi8KKyAgICAgICAgaXhFdGhEQlVwZGF0ZVBvcnRMZWFybmluZ1RyZWVzKHRyaWdnZXJQb3J0cyk7CisgICAgfQorfQorCitJWF9FVEhfREJfUFVCTElDCitJeEV0aERCU3RhdHVzIGl4RXRoREJEYXRhYmFzZUNsZWFyKEl4RXRoREJQb3J0SWQgcG9ydElELCBJeEV0aERCUmVjb3JkVHlwZSByZWNvcmRUeXBlKQoreworICAgIEl4RXRoREJQb3J0TWFwIHRyaWdnZXJQb3J0czsKKyAgICBIYXNoSXRlcmF0b3IgaXRlcmF0b3I7CisKKyAgICBpZiAocG9ydElEID49IElYX0VUSF9EQl9OVU1CRVJfT0ZfUE9SVFMgJiYgcG9ydElEICE9IElYX0VUSF9EQl9BTExfUE9SVFMpCisgICAgeworICAgICAgICByZXR1cm4gSVhfRVRIX0RCX0lOVkFMSURfUE9SVDsKKyAgICB9CisKKyAgICAvKiBjaGVjayBpZiB0aGUgdXNlciBwYXNzZXMgc29tZSBleHRyYSBiaXRzICovCisgICAgaWYgKChyZWNvcmRUeXBlIHwgSVhfRVRIX0RCX0FMTF9SRUNPUkRfVFlQRVMpICE9IElYX0VUSF9EQl9BTExfUkVDT1JEX1RZUEVTKQorICAgIHsKKyAgICAgICAgcmV0dXJuIElYX0VUSF9EQl9JTlZBTElEX0FSRzsKKyAgICB9CisKKyAgICBTRVRfRU1QVFlfREVQRU5ERU5DWV9NQVAodHJpZ2dlclBvcnRzKTsKKyAgICAKKyAgICAvKiBicm93c2UgZGF0YWJhc2UgYW5kIGFnZSBlbnRyaWVzICovCisgICAgQlVTWV9SRVRSWShpeEV0aERCSW5pdEhhc2hJdGVyYXRvcigmZGJIYXNodGFibGUsICZpdGVyYXRvcikpOworCisgICAgd2hpbGUgKElTX0lURVJBVE9SX1ZBTElEKCZpdGVyYXRvcikpCisgICAgeworICAgICAgICBNYWNEZXNjcmlwdG9yICpkZXNjcmlwdG9yID0gKE1hY0Rlc2NyaXB0b3IgKikgaXRlcmF0b3Iubm9kZS0+ZGF0YTsKKworICAgICAgICBpZiAoKChkZXNjcmlwdG9yLT5wb3J0SUQgPT0gcG9ydElEKSB8fCAocG9ydElEID09IElYX0VUSF9EQl9BTExfUE9SVFMpKQorICAgICAgICAgICAgJiYgKChkZXNjcmlwdG9yLT50eXBlICYgcmVjb3JkVHlwZSkgIT0gMCkpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIGFkZCB0byB0cmlnZ2VyIGlmIGF1dG9tYXRpYyB1cGRhdGVzIGFyZSByZXF1aXJlZCAqLworICAgICAgICAgICAgaWYgKGl4RXRoREJQb3J0VXBkYXRlUmVxdWlyZWRbZGVzY3JpcHRvci0+dHlwZV0pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogYWRkIHBvcnQgdG8gdGhlIHNldCBvZiB1cGRhdGUgdHJpZ2dlciBwb3J0cyAqLworICAgICAgICAgICAgICAgIEpPSU5fUE9SVF9UT19NQVAodHJpZ2dlclBvcnRzLCBkZXNjcmlwdG9yLT5wb3J0SUQpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKiBkZWxldGUgZW50cnkgKi8K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oREJTcGFubmluZ1RyZWVCbG9ja2luZ1N0YXRlU2V0KChJeEV0aERCUG9ydElkKSBwb3J0SUQsIEZBTFNFKTsKKyAgICAgICAgfQorCisgICAgICAgIC8qIEZpcmV3YWxsICovCisgICAgICAgIGlmICgocG9ydEluZm8tPmZlYXR1cmVDYXBhYmlsaXR5ICYgSVhfRVRIX0RCX0ZJUkVXQUxMKSAhPSAwKQorICAgICAgICB7CisgICAgICAgICAgICBpeEV0aERCRmlyZXdhbGxNb2RlU2V0KChJeEV0aERCUG9ydElkKSBwb3J0SUQsIElYX0VUSF9EQl9GSVJFV0FMTF9CTEFDS19MSVNUKTsKKyAgICAgICAgICAgIGl4RXRoREJGaXJld2FsbFRhYmxlRG93bmxvYWQoKEl4RXRoREJQb3J0SWQpIHBvcnRJRCk7CisgICAgICAgICAgICBpeEV0aERCRmlyZXdhbGxJbnZhbGlkQWRkcmVzc0ZpbHRlckVuYWJsZSgoSXhFdGhEQlBvcnRJZCkgcG9ydElELCBGQUxTRSk7CisgICAgICAgIH0KKworICAgICAgICAvKiBGcmFtZSBzaXplIGZpbHRlciAqLworICAgICAgICBpeEV0aERCRmlsdGVyaW5nUG9ydE1heGltdW1GcmFtZVNpemVTZXQoKEl4RXRoREJQb3J0SWQpIHBvcnRJRCwgSVhfRVRIX0RCX0RFRkFVTFRfRlJBTUVfU0laRSk7CisKKyAgICAgICAgLyogV2lGaSAqLworICAgICAgICBpZiAoKHBvcnRJbmZvLT5mZWF0dXJlQ2FwYWJpbGl0eSAmIElYX0VUSF9EQl9XSUZJX0hFQURFUl9DT05WRVJTSU9OKSAhPSAwKQorICAgICAgICB7CisgICAgICAgICAgICBpeEV0aERCV2lGaUNvbnZlcnNpb25UYWJsZURvd25sb2FkKChJeEV0aERCUG9ydElkKSBwb3J0SUQpOworICAgICAgICB9CisKKyAgICAgICAgLyogc2F2ZSBhbmQgZGlzYWJsZSB0aGUgbGVhcm5pbmcgZmVhdHVyZSBiaXQgKi8KKyAgICAgICAgb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eEV0aERCUG9ydElkIHBvcnRJRCwgVUlOVDMyIG1heGltdW1GcmFtZVNpemUpCit7CisgICAgSVhfRVRIX0RCX0NIRUNLX1BPUlRfRVhJU1RTKHBvcnRJRCk7CisKKyAgICBJWF9FVEhfREJfQ0hFQ0tfU0lOR0xFX05QRShwb3J0SUQpOworCisgICAgaWYgKCFpeEV0aERCUG9ydEluZm9bcG9ydElEXS5pbml0aWFsaXplZCkKKyAgICB7CisgICAgICAgIHJldHVybiBJWF9FVEhfREJfUE9SVF9VTklOSVRJQUxJWkVEOworICAgIH0KKworICAgIGlmIChpeEV0aERCUG9ydERlZmluaXRpb25zW3BvcnRJRF0udHlwZSA9PSBJWF9FVEhfTlBFKQorICAgIHsKKwlpZiAoKG1heGltdW1GcmFtZVNpemUgPCBJWF9FVEhEQl9NSU5fTlBFX0ZSQU1FX1NJWkUpIHx8CisJICAgIChtYXhpbXVtRnJhbWVTaXplID4gSVhfRVRIREJfTUFYX05QRV9GUkFNRV9TSVpFKSkKKwl7CisJICAgIHJldHVybiBJWF9FVEhfREJfSU5WQUxJRF9BUkc7CisJfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICByZXR1cm4gSVhfRVRIX0RCX05PX1BFUk1JU1NJT047CisgICAgfQorCisgICAgLyogdXBkYXRlIGludGVybmFsIHN0cnVjdHVyZSAqLworICAgIGl4RXRoREJQb3J0SW5mb1twb3J0SURdLm1heFJ4RnJhbWVTaXplID0gbWF4aW11bUZyYW1lU2l6ZTsKKyAgICBpeEV0aERCUG9ydEluZm9bcG9ydElEXS5tYXhUeEZyYW1lU2l6ZSA9IG1heGltdW1GcmFtZVNpemU7CisKKyAgICAvKiB1cGRhdGUgdGhlIG1heGltdW0gZnJhbWUgc2l6ZSBpbiB0aGUgTlBFICovCisgICAgcmV0dXJuIGl4RXRoREJQb3J0RnJhbWVMZW5ndGhzVXBkYXRlKHBvcnRJRCk7Cit9CisKKy8qKgorICogQGJyaWVmIHNldHMgdGhlIE1BQyB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gaWYgKCFldGhEQkluaXRpYWxpemF0aW9uQ29tcGxldGUpCisgICAgeworICAgICAgICAvKiByZWR1bmRhbnQgKi8KKyAgICAgICAgcmV0dXJuIElYX0VUSF9EQl9TVUNDRVNTOworICAgIH0KKworICAgIC8qIGNoZWNrIGlmIGFueSBwb3J0cyBhcmUgZW5hYmxlZCAqLworICAgIGZvciAocG9ydEluZGV4ID0gMCA7IHBvcnRJbmRleCA8IElYX0VUSF9EQl9OVU1CRVJfT0ZfUE9SVFMgOyBwb3J0SW5kZXgrKykKKyAgICB7CisgICAgICAgIGlmIChpeEV0aERCUG9ydEluZm9bcG9ydEluZGV4XS5lbmFibGVkKQorICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gSVhfRVRIX0RCX0JVU1k7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiBmcmVlIHBvcnQgcmVzb3VyY2VzICovCisgICAgZm9yIChwb3J0SW5kZXggPSAwIDsgcG9ydEluZGV4IDwgSVhfRVRIX0RCX05VTUJFUl9PRl9QT1JUUyA7IHBvcnRJbmRleCsrKQorICAgIHsKKyAgICAgICAgaWYgKGl4RXRoREJQb3J0RGVmaW5pdGlvbnNbcG9ydEluZGV4XS50eXBlID09IElYX0VUSF9OUEUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGl4T3NhbE11dGV4RGVzdHJveSgmaXhFdGhEQlBvcnRJbmZvW3BvcnRJbmRleF0ubnBlQWNrTG9jayk7CisgICAgICAgIH0KKworICAgICAgICBpeEV0aERCUG9ydEluZm9bcG9ydEluZGV4XS5pbml0aWFsaXplZCA9IEZBTFNFOworICAgIH0KKworICAgIC8qIHNodXRkb3duIGV2ZW50IHByb2Nlc3NvciAqLworICAgIGl4RXRoREJTdG9wTGVhcm5pbmdGdW5jdGlvbigpOworCisgICAgLyogZGVhbGxvY2F0ZSBOUEUgdXBkYXRlIHpvbmVzICovCisgICAgaXhFdGhEQk5QRVVwZGF0ZUFyZWFzVW5sb2FkKCk7CisKKyAgICB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FTVBUWV9ERVBFTkRFTkNZX01BUCh0cmlnZ2VyUG9ydHMpOworCisgICAgICAgICAgICB3aGlsZSAoa2VlcFByb2Nlc3NpbmcpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgUG9ydEV2ZW50IGxvY2FsX2V2ZW50OworICAgICAgICAgICAgICAgIFVJTlQzMiBpbnRMb2NrS2V5OworCisgICAgICAgICAgICAgICAgLyogbG9jayBxdWV1ZSAqLworICAgICAgICAgICAgICAgIGl4T3NhbE11dGV4TG9jaygmZXZlbnRRdWV1ZUxvY2ssIElYX09TQUxfV0FJVF9GT1JFVkVSKTsKKworICAgICAgICAgICAgICAgIC8qIGxvY2sgTlBFIGludGVycnVwdHMgKi8KKyAgICAgICAgICAgICAgICBpbnRMb2NrS2V5ID0gaXhPc2FsSXJxTG9jaygpOworCisgICAgICAgICAgICAgICAgLyogZXh0cmFjdCBldmVudCAqLworICAgICAgICAgICAgICAgIGxvY2FsX2V2ZW50ID0gKihRVUVVRV9UQUlMKCZldmVudFF1ZXVlKSk7CisKKyAgICAgICAgICAgICAgICBTSElGVF9VUERBVEVfUVVFVUUoJmV2ZW50UXVldWUpOworCisgICAgICAgICAgICAgICAgaXhPc2FsSXJxVW5sb2NrKGludExvY2tLZXkpOworCisgICAgICAgICAgICAgICAgaXhPc2FsTXV0ZXhVbmxvY2soJmV2ZW50UXVldWVMb2NrKTsKKworICAgICAgICAgICAgICAgIElYX0VUSF9EQl9FVkVOVFNfVFJBQ0UoIkRCOiAoRXZlbnRzKSBQcm9jZXNzaW5nIGV2ZW50IHdpdGggSUQgMHglWFxuIiwgbG9jYWxfZXZlbnQuZXZlbnRUeXBlKTsKKworICAgICAgICAgICAgICAgIGl4RXRoREJQcm9jZXNzRXZlbnQoJmxvY2FsX2V2ZW50LCB0cmlnZ2VyUG9ydHMpOworCisgICAgICAgICAgICAgICAgcHJvY2Vzc2VkRXZlbnRzKys7CisKKyAgICAgICAgICAgICAgICBpZiAocHJvY2Vzc2VkRX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dHJpZ2dlclBvcnRzKTsKKworICAgICAgICAgICAgSVhfRVRIX0RCX0VWRU5UU19UUkFDRSgiREI6IChFdmVudHMpIEFkZGVkIHJlY29yZCBvbiBwb3J0ICVkXG4iLCBsb2NhbF9ldmVudC0+cG9ydElEKTsKKworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBJWF9FVEhfREJfUkVNT1ZFX0ZJTFRFUklOR19SRUNPUkQ6CisgICAgICAgICAgICAvKiByZW1vdmUgcmVjb3JkICovCisgICAgICAgICAgICBtZW1zZXQoJnJlY29yZFRlbXBsYXRlLCAwLCBzaXplb2YgKHJlY29yZFRlbXBsYXRlKSk7CisgICAgICAgICAgICBtZW1jcHkocmVjb3JkVGVtcGxhdGUubWFjQWRkcmVzcywgbG9jYWxfZXZlbnQtPm1hY0FkZHIubWFjQWRkcmVzcywgc2l6ZW9mIChJeEV0aERCTWFjQWRkcikpOworICAgICAgICAgICAgCisgICAgICAgICAgICByZWNvcmRUZW1wbGF0ZS50eXBlID0gSVhfRVRIX0RCX0ZJTFRFUklOR19SRUNPUkQgfCBJWF9FVEhfREJfRklMVEVSSU5HX1ZMQU5fUkVDT1JEOworICAgICAgICAgICAgCisgICAgICAgICAgICBpeEV0aERCUmVtb3ZlKCZyZWNvcmRUZW1wbGF0ZSwgdHJpZ2dlclBvcnRzKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgSVhfRVRIX0RCX0VWRU5UU19UUkFDRSgiREI6IChFdmVudHMpIFJlbW92ZWQgcmVjb3JkIG9uIHBvcnQgJWRcbiIsIGxvY2FsX2V2ZW50LT5wb3J0SUQpOworCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgLyogY2FuJ3QgaGFuZGxlL25vdCBpbnRlcmVzdGVkIGluIHRoaXMgZXZlbnQgdHlwZSAqLworICAgICAgICAgICAgRVJST1JfTE9HKCJEQjogKEV2ZW50cykgRXZlbnQgcHJvY2Vzc29yI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MzIgZXZlbnRUeXBlLCBJeEV0aERCTWFjQWRkciAqbWFjQWRkciwgSXhFdGhEQlBvcnRJZCBwb3J0SUQsIEJPT0wgc3RhdGljRW50cnkpCit7CisgICAgVUlOVDMyIGludExvY2tLZXk7CisKKyAgICAvKiBsb2NrIGludGVycnVwdHMgdG8gcHJvdGVjdCBxdWV1ZSAqLworICAgIGludExvY2tLZXkgPSBpeE9zYWxJcnFMb2NrKCk7CisKKyAgICBpZiAoQ0FOX0VOUVVFVUUoJmV2ZW50UXVldWUpKQorICAgIHsKKyAgICAgICAgUG9ydEV2ZW50ICpxdWV1ZUV2ZW50ID0gUVVFVUVfSEVBRCgmZXZlbnRRdWV1ZSk7CisKKyAgICAgICAgLyogdXBkYXRlIGZpZWxkcyBvbiB0aGUgcXVldWUgKi8KKyAgICAgICAgbWVtY3B5KHF1ZXVlRXZlbnQtPm1hY0FkZHIubWFjQWRkcmVzcywgbWFjQWRkci0+bWFjQWRkcmVzcywgc2l6ZW9mIChJeEV0aERCTWFjQWRkcikpOworICAgICAgICAKKyAgICAgICAgcXVldWVFdmVudC0+ZXZlbnRUeXBlICAgICA9IGV2ZW50VHlwZTsKKyAgICAgICAgcXVldWVFdmVudC0+cG9ydElEICAgICAgICA9IHBvcnRJRDsKKyAgICAgICAgcXVldWVFdmVudC0+c3RhdGljRW50cnkgICA9IHN0YXRpY0VudHJ5OworCisgICAgICAgIFBVU0hfVVBEQVRFX1FVRVVFKCZldmVudFF1ZXVlKTsKKworICAgICAgICAvKiBpbWNyZW1lbnQgZXZlbnQgcXVldWUgc2VtYXBob3JlICovCisgICAgICAgIGl4T3NhbFNlbWFwaG9yZVBvc3QoJmV2ZW50UXVldWVTZW1hcGhvcmUpOworICAgICAgICAKKyAgICAgICAgLyogdW5sb2NrIGludGVycnVwdHMgKi8KKyAgICAgICAgaXhPc2FsSXJxVW5sb2NrKGludExvY2tLZXkpOworCisgICAgICAgIHJldHVybiBJWF9FVEhfREJfU1VDQ0VTUzsKKyAg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vZiBMRUFSTklORyBieSBkZWZhdWx0ICovCisgICAgICAgIHBvcnRJbmZvLT5mZWF0dXJlQ2FwYWJpbGl0eSB8PSBJWF9FVEhfREJfTEVBUk5JTkc7CisgICAgICAgIHBvcnRJbmZvLT5mZWF0dXJlU3RhdHVzICAgICB8PSBJWF9FVEhfREJfTEVBUk5JTkc7CisKKyAgICAgICAgaWYgKGl4RXRoREJQb3J0RGVmaW5pdGlvbnNbcG9ydEluZGV4XS50eXBlID09IElYX0VUSF9OUEUpCisgICAgICAgIHsKKworICAgICAgICAgICAgaWYgKGl4TnBlRGxMb2FkZWRJbWFnZUdldChJWF9FVEhfREJfUE9SVF9JRF9UT19OUEUocG9ydEluZGV4KSwgJmltYWdlSWQpICE9IElYX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgV0FSTklOR19MT0coIkRCOiAoRmVhdHVyZVNjYW4pIE5wZURsIGRpZCBub3QgcHJvdmlkZSB0aGUgaW1hZ2UgSUQgZm9yIE5QRSBwb3J0ICVkXG4iLCBwb3J0SW5kZXgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIGluaXRpYWxpemUgYW5kIGVtcHR5IE5QRSByZXNwb25zZSBtdXRleCAqLworICAgICAgICAgICAgICAgIGl4T3NhbE11dGV4SW5pdCgmcG9ydEluZm8tPm5wZUFja0xvY2spOworICAgICAgICAgICAgICAgIGl4T3NhbE11dGV4TG9jaygmcG9ydEluZm8tPm5wZUFja0xvY2ssIElYX09TQUxfV0FJVF9GT1JFVkVSKTsKKworICAgICAgICAgICAgICAgIC8qIGNoZWNrIE5QRSByZXNwb25zZSB0byBHZXRTdGF0dXMgKi8KKyAgICAgICAgICAgICAgICBtc2cuZGF0YVswXSA9IElYX0VUSE5QRV9OUEVfR0VUU1RBVFVTIDw8IDI0OworICAgICAgICAgICAgICAgIG1zZy5kYXRhWzFdID0gMDsKKyAgICAgICAgICAgICAgICBJWF9FVEhEQl9TRU5EX05QRV9NU0coSVhfRVRIX0RCX1BPUlRfSURfVE9fTlBFKHBvcnRJbmRleCksIG1zZywgcmVzdWx0KTsKKyAgICAgICAgICAgICAgICBpZiAocmVzdWx0ICE9IElYX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBXQVJOSU5HX0xPRygiREI6IChGZWF0dXJlU2Nhbikgd2FybmluZywgY291bGQgbm90IHNlbmQgbWVzc2FnZSB0byB0aGUgTlBFXG4iKTsKKyAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgfQorCisKKyAgICAgICAgICAgICAgICBpZiAoaW1hZ2VJZC5mdW5jdGlvbmFsaXR5SWQgPT0gMHgwMAorICAgICAgICAgICAgICAgICAgICB8fCBpbWFnZUlkLmZ1bmN0aW9uYWxpdHlJZCA9PSAweDAzCisgICAgICAgICAgICAgICAgICAgIHx8IGltYWdlSWQuZnVuY3Rpb25hbGl0eUlkID09IDB4MDQKKyAgICAgICAgICAgICAgICAgICAgfHwgaW1hZ2VJZC5mdW5jdGlvbmFsaXR5SWQgPT0gMHg4MCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHBvcnRJbmZvLT5mZWF0dXJlQ2FwYWJpbGl0eSB8PSBJWF9FVEhfREJfRklMVEVSSU5HOworICAgICAgICAgICAgICAgICAgICBwb3J0SW5mby0+ZmVhdHVyZUNhcGFiaWxpdHkgfD0gSVhfRVRIX0RCX0ZJUkVXQUxMOworICAgICAgICAgICAgICAgICAgICBwb3J0SW5mby0+ZmVhdHVyZUNhcGFiaWxpdHkgfD0gSVhfRVRIX0RCX1NQQU5OSU5HX1RSRUVfUFJPVE9DT0w7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKGltYWdlSWQuZnVuY3Rpb25hbGl0eUlkID09IDB4MDEKKyAgICAgICAgICAgICAgICAgICAgICAgICB8fCBpbWFnZUlkLmZ1bmN0aW9uYWxpdHlJZCA9PSAweDgxKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcG9ydEluZm8tPmZlYXR1cmVDYXBhYmlsaXR5IHw9IElYX0VUSF9EQl9GSUxURVJJTkc7CisgICAgICAgICAgICAgICAgICAgIHBvcnRJbmZvLT5mZWF0dXJlQ2FwYWJpbGl0eSB8PSBJWF9FVEhfREJfRklSRVdBTEw7CisgICAgICAgICAgICAgICAgICAgIHBvcnRJbmZvLT5mZWF0dXJlQ2FwYWJpbGl0eSB8PSBJWF9FVEhfREJfU1BBTk5JTkdfVFJFRV9QUk9UT0NPTDsKKyAgICAgICAgICAgICAgICAgICAgcG9ydEluZm8tPmZlYXR1cmVDYXBhYmlsaXR5IHw9IElYX0VUSF9EQl9WTEFOX1FPUzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoaW1hZ2VJZC5mdW5jdGlvbmFsaXR5SWQgPT0gMHgwMgorICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGltYWdlSWQuZnVuY3Rpb25hbGl0eUlkID09IDB4ODIpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwb3J0SW5mby0+ZmVhdHVyZUNhcGFiaWxpdHkgfD0gSVhfRVRIX0RCX1dJRklfSEVBREVSX0NPTlZFUlNJT047CisgICAgICAgICAgICAgICAgICAgIHBvcnRJbmZvLT5mZWF0dXJlQ2FwYWJpbGl0eSB8PSBJWF9FVEhfREJfRklSRVdBTEw7CisgICAgICAgICAgICAgICAgICAgIHBvcnRJbmZvLT5mZWF0dXJlQ2FwYWJpbGl0eSB8PSBJWF9FVEhfREJfU1BBTk5JTkdfVFJFRV9QUk9UT0NPTDsKKyAgICAgICAgICAgICAgICAgICAgcG9ydEluZm8tPmZlYXR1cmVDYXBhYmlsaXR5IHw9IElYX0VUSF9EQl9WTEFOX1FPUzsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvKiByZXNldCBBUU0gcXVldWVzICovCisgICAgICAgICAgICAgICAgbWVtc2V0KHBvcnRJbmZvLT5peEV0aERCVHJhZmZpY0NsYXNzQVFNQXNzaWdubWVudHMsIDAsIHNpemVvZiAocG9ydEluZm8tPml4RXRoREJUcmFmZmljQ2xhc3NBUU1Bc3NpZ25tZW50cykpOworCisgICAgICAgICAgICAgICAgLyogZW5zdXJlIHRoZXJlJ3MgYXQgbGVhc3Qgb25lIHRyYWZmaWMgY2xhc3MgcmVjb3JkIGluIHRoZSBkZWZpbml0aW9uIHRhYmxlLCBvdGhlcndpc2Ugd2UgaGF2ZSBubyBkZWZhdWx0IGNhc2UsIGhlbmNlIG5vIHF1ZXVlcyAqLworICAgICAgICAgICAgICAgIElYX0VOU1VSRShzaXplb2YgKGl4RXRoREJUcmFmZmljQ2xhc3NEZWZpbml0aW9ucykgIT0gMCwgIkRCOiBubyB0cmFmZmljIGNsYXNzIGRlZmluaXRpb25zIGZvdW5kLCBjaGVjayBJeEV0aERCUW9TLmgiKTsKKworICAgICAgICAgICAgICAgIC8qIGZpbmQgdGhlIHRyYWZmaWMgY2xhc3MgZGVmaW5pdGlvbiBpbmRleCBjb21wYXRpYmxlIHdpdGggdGhlIGN1cnJlbnQgTlBFIEEgZnVuY3Rpb25hbGl0eSBJRCAqLworICAgICAgICAgICAgICAgIGZvciAodHJhZmZpY0NsYXNzRGVmaW5pdGlvbkluZGV4ID0gMCA7CisgICAgICAgICAgICAgICAgICAgIHRyYWZmaWNDbGFzc0RlZmluaXRpb25JbmRleCA8IHNpemVvZiAoaXhFdGhEQlRyYWZmaWNDbGFzc0RlZmluaXRpb25zKSAvIHNpemVvZiAoaXhFdGhEQlRyYWZmaWNDbGFzc0RlZmluaXRpb25zWzBdKTsKKyAgICAgICAgICAgICAgICAgICAgdHJhZmZpY0NsYXNzRGVmaW5pdGlvbkluZGV4KyspCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAoaXhFdGhEQlRyYWZmaWNDbGFzc0RlZmluaXRpb25zW3RyYWZmaWNDbGFzc0RlZmluaXRpb25JbmRleF1bSVhfRVRIX0RCX05QRV9BX0ZVTkNUSU9OQUxJVFlfSURfSU5ERVhdID09IG5wZUFJbWFnZUlkLmZ1bmN0aW9uYWxpdHlJZCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLyogZm91bmQgaXQgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLyogc2VsZWN0IHRoZSBkZWZhdWx0IGNhc2UgaWYgd2Ugd2VudCBvdmVyIHRoZSBhcnJheSBib3VuZGFyeSAqLworICAgICAgICAgICAgICAgIGlmICh0cmFmZmljQ2xhc3NEZWZpbml0aW9uSW5kZXggPT0gc2l6ZW9mIChpeEV0aERCVHJhZmZpY0NsYXNzRGVmaW5pdGlvbnMpIC8gc2l6ZW9mIChpeEV0aERCVHJhZmZpY0NsYXNzRGVmaW5pdGlvbnNbMF0pKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdHJhZmZpY0NsYXNzRGVmaW5pdGlvbkluZGV4ID0gMDsgLyogdGhlIGZpcnN0IHJlY29yZCBpcyB0aGUgZGVmYXVsdCBjYXNlICovCisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLyogc2VsZWN0IHF1ZXVlIGFzc2lnbm1lbnQgc3RydWN0dXJlIGJhc2VkIG9uIHRoZSB0cmFmZmljIGNsYXNzIGNvbmZpZ3VyYXRpb24gaW5kZXggKi8KKyAgICAgICAgICAgICAgICBxdWV1ZVN0cnVjdHVyZUluZGV4ID0gaXhFdGhEQlRyYWZmaWNDbGFzc0RlZmluaXRpb25zW3RyYWZmaWNDbGFzc0RlZmluaXRpb25JbmRleF1bSVhfRVRIX0RCX1F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vUyBjYXBhYmxlICovCisgICAgICAgICAgICAgICAgICAgIHBvcnRJbmZvLT5peEV0aERCVHJhZmZpY0NsYXNzQXZhaWxhYmxlID0gaXhFdGhEQlRyYWZmaWNDbGFzc0RlZmluaXRpb25zW3RyYWZmaWNDbGFzc0RlZmluaXRpb25JbmRleF1bSVhfRVRIX0RCX1RSQUZGSUNfQ0xBU1NfQ09VTlRfSU5ERVhdOworCisgICAgICAgICAgICAgICAgICAgIC8qIHNldCBBUU0gcXVldWVzICovCisgICAgICAgICAgICAgICAgICAgIGZvciAocXVldWVJbmRleCA9IDAgOyBxdWV1ZUluZGV4IDwgSVhfSUVFRTgwMl8xUV9RT1NfUFJJT1JJVFlfQ09VTlQgOyBxdWV1ZUluZGV4KyspCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvcnRJbmZvLT5peEV0aERCVHJhZmZpY0NsYXNzQVFNQXNzaWdubWVudHNbcXVldWVJbmRleF0gPSBpeEV0aERCUXVldWVBc3NpZ25tZW50c1txdWV1ZVN0cnVjdHVyZUluZGV4XVtxdWV1ZUluZGV4XTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8qIHNldCBkZWZhdWx0IFBWSUQgKDApIGFuZCBkZWZhdWx0IHRyYWZmaWMgY2xhc3MgMCAqLworICAgICAgICAgICAgICAgICAgICBpeEV0aERCUG9ydFZsYW5UYWdTZXQocG9ydEluZGV4LCAwKTsKKworICAgICAgICAgICAgICAgICAgICAvKiBlbmFibGUgcmVjZXB0aW9uIG9mIGFsbCBmcmFtZXMgKi8KKyAgICAgICAgICAgICAgICAgICAgaXhFdGhEQkFjY2VwdGFibGVGcmFtZVR5cGVTZXQocG9ydEluZGV4LCBJWF9FVEhfREJfQUNDRVBUX0FMTF9GUkFNRVMpOworCisgICAgICAgICAgICAgICAgICAgIC8qIGNsZWFyIGZ1bGwgVkxBTiBtZW1iZXJzaGlwICovCisgICAgICAgICAgICAgICAgICAgIGl4RXRoREJQb3J0Vmxhbk1lbWJlcnNoaXBSYW5nZVJlbW92ZShwb3J0SW5kZXgsIDAsIElYX0VUSF9EQl84MDJfMVFfTUFYX1ZMQU5fSUQpOworCisgICAgICAgICAgICAgICAgICAgIC8qIGNsZWFyIFRUSSB0YWJsZSAtIG5vIFZMQU4gdGFnZ2VkIGZyYW1lcyB3aWxsIGJlIHRyYW5zbWl0dGVkICovCisgICAgICAgICAgICAgICAgICAgIGl4RXRoREJFZ3Jlc3NWbGFuUmFuZ2VUYWdnaW5nRW5hYmxlZFNldChwb3J0SW5kZXgsIDAsIDQwOTQsIEZBTFNFKTsKKworICAgICAgICAgICAgICAgICAgICAvKiBzZXQgbWVtYmVyc2hpcCBvbiAwLCBvdGhlcndpc2Ugbm8gVHggb3IgUnggaXMgd29ya2luZyAqLworICAgICAgICAgICAgICAgICAgICBpeEV0aERCUG9ydFZsYW5NZW1iZXJzaGlwQWRkKHBvcnRJbmRleCwgMCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgLyogUW9TIG5vdCBhdmFpbGFibGUgaW4gdGhpcyBpbWFnZSAqLworI2VuZGlmIC8qIHRlc3Qtb25seSAqLworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogaW5pdGlhbGl6ZSB0cmFmZmljIGNsYXNzIGF2YWlsYWJpbGl0eSAob25seSBjbGFzcyAwIGlzIGF2YWlsYWJsZSkgKi8KKyAgICAgICAgICAgICAgICAgICAgcG9ydEluZm8tPml4RXRoREJUcmFmZmljQ2xhc3NBdmFpbGFibGUgPSAxOworCisgICAgICAgICAgICAgICAgICAgIC8qIHBvaW50IGFsbCBBUU0gcXVldWVzIHRvIHRyYWZmaWMgY2xhc3MgMCAqLworICAgICAgICAgICAgICAgICAgICBmb3IgKHF1ZXVlSW5kZXggPSAwIDsgcXVldWVJbmRleCA8IElYX0lFRUU4MDJfMVFfUU9TX1BSSU9SSVRZX0NPVU5UIDsgcXVldWVJbmRleCsrKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBwb3J0SW5mby0+aXhFdGhEQlRyYWZmaWNDbGFzc0FRTUFzc2lnbm1lbnRzW3F1ZXVlSW5kZXhdID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpeEV0aERCUXVldWVBc3NpZ25tZW50c1txdWV1ZVN0cnVjdHVyZUluZGV4XVswXTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworI2lmZGVmIENPTkZJR19XSVRIX1ZMQU4gLyogdGVzdC1vbmx5OiBWTEFOIHN1cHBvcnQgbm90IGluY2x1ZGVkIHRvIHNhdmUgc3BhY2UhISEgKi8KKyAgICAgICAgICAgICAgICAvKiBkb3dubG9hZCBwcmlvcml0eSBtYXBwaW5nIHRhYmxlIGFuZCBSeCBxdWV1ZSBjb25maWd1cmF0aW9uICovCisgICAgICAgICAgICAgICAgbWVtc2V0IChkZWZhdWx0UHJpb3JpdHlUYWJsZSwgMCwgc2l6ZW9mIChkZWZhdWx0UHJpb3JpdHlUYWJsZSkpOworICAgICAgICAgICAgICAgIGl4RXRoREJQcmlvcml0eU1hcHBpbmdUYWJsZVNldChwb3J0SW5kZXgsIGRlZmF1bHRQcmlvcml0eVRhYmxlKTsKKyNlbmRpZgorCisgICAgICAgICAgICAgICAgLyogYnkgZGVmYXVsdCB3ZSB0dXJuIG9mZiBpbnZhbGlkIHNvdXJjZSBNQUMgYWRkcmVzcyBmaWx0ZXJpbmcgKi8KKyAgICAgICAgICAgICAgICBpeEV0aERCRmlyZXdhbGxJbnZhbGlkQWRkcmVzc0ZpbHRlckVuYWJsZShwb3J0SW5kZXgsIEZBTFNFKTsKKworICAgICAgICAgICAgICAgIC8qIGRpc2FibGUgcG9ydCwgVkxBTiwgRmlyZXdhbGwgZmVhdHVyZSBiaXRzICovCisgICAgICAgICAgICAgICAgcG9ydEluZm8tPmZlYXR1cm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YWJsZSk7CisKKyAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gSVhfRVRIX0RCX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gaXhFdGhEQkFjY2VwdGFibGVGcmFtZVR5cGVTZXQocG9ydElELCBJWF9FVEhfREJfQUNDRVBUX0FMTF9GUkFNRVMpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoc3RhdHVzID09IElYX0VUSF9EQl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGl4RXRoREJJbmdyZXNzVmxhblRhZ2dpbmdFbmFibGVkU2V0KHBvcnRJRCwgSVhfRVRIX0RCX1BBU1NfVEhST1VHSCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qIHNldCBtZW1iZXJzaGlwIGFuZCBUVEkgdGFibGVzICovCisgICAgICAgICAgICBtZW1zZXQgKHZsYW5TZXQsIDB4RkYsIHNpemVvZiAodmxhblNldCkpOworCisgICAgICAgICAgICBpZiAoc3RhdHVzID09IElYX0VUSF9EQl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIHVzZSB0aGUgaW50ZXJuYWwgZnVuY3Rpb24gdG8gYnlwYXNzIFBWSUQgY2hlY2sgKi8KKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBpeEV0aERCUG9ydFZsYW5UYWJsZVNldChwb3J0SUQsIHBvcnRJbmZvLT52bGFuTWVtYmVyc2hpcCwgdmxhblNldCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gSVhfRVRIX0RCX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogdXNlIHRoZSBpbnRlcm5hbCBmdW5jdGlvbiB0byBieXBhc3MgUFZJRCBjaGVjayAqLworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGl4RXRoREJQb3J0VmxhblRhYmxlU2V0KHBvcnRJRCwgcG9ydEluZm8tPnRyYW5zbWl0VGFnZ2luZ0luZm8sIHZsYW5TZXQpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKiByZXNldCB0aGUgUFZJRCAqLworICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBJWF9FVEhfREJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBpeEV0aERCUG9ydFZsYW5UYWdTZXQocG9ydElELCAwKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyogZW5hYmxlIFRQSUQgcG9ydCBleHRyYWN0aW9uICovCisgICAgICAgICAgICBpZiAoc3RhdHVzID09IElYX0VUSF9EQl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGl4RXRoREJWbGFuUG9ydEV4dHJhY3Rpb25FbmFibGUocG9ydElELCBUUlVFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChmZWF0dXJlID09IElYX0VUSF9EQl9GSVJFV0FMTCkKKyNlbmRpZgorICAgICAgICB7CisgICAgICAgICAgICAvKiBmaXJld2FsbCBzdGFydHMgaW4gYmxhY2stbGlzdCBtb2RlIHVubGVzcyBvdGhlcndpc2UgY29uZmlndXJlZCBiZWZvcmUgKgorICAgICAgICAgICAgICogbm90ZSB0aGF0IGludmFsaWQgc291cmNlIE1BQyBhZGRyZXNzIGZpbHRlcmluZyBpcyBkaXNhYmxlZCBieSBkZWZhdWx0ICovCisgICAgICAgICAgICBpZiAocG9ydEluZm8tPmZpcmV3YWxsTW9kZSAhPSBJWF9FVEhfREJfRklSRVdBTExfQkxBQ0tfTElTVAorICAgICAgICAgICAgICAgICYmIHBvcnRJbmZvLT5maXJld2FsbE1vZGUgIT0gSVhfRVRIX0RCX0ZJUkVXQUxMX1dISVRFX0xJU1QpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc3RhdHVzID0gaXhFdGhEQkZpcmV3YWxsTW9kZVNldChwb3J0SUQsIElYX0VUSF9EQl9GSVJFV0FMTF9CTEFDS19MSVNUKTsKKworICAgICAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gSVhfRVRIX0RCX1NVQ0NFU1MpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBpeEV0aERCRmlyZXdhbGxJbnZhbGlkQWRkcmVzc0ZpbHRlckVuYWJsZShwb3J0SUQsIEZBTFNFKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoc3RhdHVzICE9IElYX0VUSF9EQl9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBjaGVja3MgZmFpbGVkLCBkaXNhYmxlICovCisgICAgICAgICAgICBwb3J0SW5mby0+ZmVhdHVyZVN0YXR1cyAmPSB+ZmVhdHVyZTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICAvKiB0dXJuIG9mZiBmZWF0dXJlcyAqLworICAgICAgICBpZiAoZmVhdHVyZSA9PSBJWF9FVEhfREJfRklSRVdBTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIHR1cm5pbmcgb2ZmIHRoZSBmaXJld2FsbCBpcyBlcXVpdmFsZW50IHRvOgorICAgICAgICAgICAgICAgIC0gc2V0IHRvIGJsYWNrLWxpc3QgbW9kZQorICAgICAgICAgICAgICAgIC0gY2xlYXIgYWxsIHRoZSBlbnRyaWVzIGFuZCBkb3dubG9hZCB0aGUgbmV3IHRhYmxlCisgICAgICAgICAgICAgICAgLSB0dXJuIG9mZiB0aGUgaW52YWxpZCBzb3VyY2UgYWRkcmVzcyBjaGVja2luZworICAgICAgICAgICAgKi8KKworICAgICAgICAgICAgc3RhdHVzID0gaXhFdGhEQkRhdGFiYXNlQ2xlYXIocG9ydElELCBJWF9FVEhfREJfRklSRVdBTExfUkVDT1JEKTsKKworICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBJWF9FVEhfREJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBpeEV0aERCRmlyZXdhbGxNb2RlU2V0KHBvcnRJRCwgSVhfRVRIX0RCX0ZJUkVXQUxMX0JMQUNLX0xJU1QpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoc3RhdHVzID09IElYX0VUSF9EQl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGl4RXRoREJGaXJld2FsbEludmFsaWRBZGRyZXNzRmlsdGVyRW5hYmxlKHBvcnRJRCwgRkFMU0UpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoc3RhdHVzID09IElYX0VUSF9EQl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGl4RXRoREJGaXJld2FsbFRhYmxlRG93bmxvYWQocG9ydElEKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlIGlmIChmZWF0dXJlID09IElYX0VUSF9EQl9XSUZJX0hFQURFUl9DT05WRVJTSU9OKQorICAgICAgICB7CisgICAgICAgICAgICAvKiB0dXJuIG9mZiBoZWFkZXIgY29udmVyc2lvbiAqLworICAgICAgICAgICAgc3RhdHVzID0gaXhFdGhEQkRhdGFiYXNlQ2xlYXIocG9ydElELCBJWF9FVEhfREJfV0lGSV9SRUNPUkQpOworCisgICAgICAgICAgICBpZiAoc3RhdHVzID09IElYX0VUSF9EQl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGl4RXRoREJXaUZpQ29udmVyc2lvblRhYmxlRG93bmxvYWQocG9ydElEKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorI2lmZGVmIENPTkZJR19XSVRIX1ZMQU4gLyogd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U2V0KHBvcnRJRCwgZGVmYXVsdFByaW9yaXR5VGFibGUpOworCisgICAgICAgICAgICBpZiAoc3RhdHVzID09IElYX0VUSF9EQl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGl4RXRoREJBY2NlcHRhYmxlRnJhbWVUeXBlU2V0KHBvcnRJRCwgSVhfRVRIX0RCX0FDQ0VQVF9BTExfRlJBTUVTKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBJWF9FVEhfREJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBpeEV0aERCSW5ncmVzc1ZsYW5UYWdnaW5nRW5hYmxlZFNldChwb3J0SUQsIElYX0VUSF9EQl9QQVNTX1RIUk9VR0gpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKiBjbGVhciBtZW1iZXJzaGlwIGFuZCBUVEkgdGFibGVzICovCisgICAgICAgICAgICBtZW1zZXQgKHZsYW5TZXQsIDAsIHNpemVvZiAodmxhblNldCkpOworCisgICAgICAgICAgICBpZiAoc3RhdHVzID09IElYX0VUSF9EQl9TVUNDRVNTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIHVzZSB0aGUgaW50ZXJuYWwgZnVuY3Rpb24gdG8gYnlwYXNzIFBWSUQgY2hlY2sgKi8KKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBpeEV0aERCUG9ydFZsYW5UYWJsZVNldChwb3J0SUQsIHBvcnRJbmZvLT52bGFuTWVtYmVyc2hpcCwgdmxhblNldCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gSVhfRVRIX0RCX1NVQ0NFU1MpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogdXNlIHRoZSBpbnRlcm5hbCBmdW5jdGlvbiB0byBieXBhc3MgUFZJRCBjaGVjayAqLworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGl4RXRoREJQb3J0VmxhblRhYmxlU2V0KHBvcnRJRCwgcG9ydEluZm8tPnRyYW5zbWl0VGFnZ2luZ0luZm8sIHZsYW5TZXQpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKiByZXNldCB0aGUgUFZJRCAqLworICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBJWF9FVEhfREJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBpeEV0aERCUG9ydFZsYW5UYWdTZXQocG9ydElELCAwKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyogZGlzYWJsZSBUUElEIHBvcnQgZXh0cmFjdGlvbiAqLworICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBJWF9FVEhfREJfU1VDQ0VTUykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzdGF0dXMgPSBpeEV0aERCVmxhblBvcnRFeHRyYWN0aW9uRW5hYmxlKHBvcnRJRCwgRkFMU0UpOworICAgICAgICAgICAgfQorICAgICAgICB9CisjZW5kaWYKKworICAgICAgICBpZiAoc3RhdHVzID09IElYX0VUSF9EQl9TVUNDRVNTKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBjaGVja3MgcGFzc2VkLCBkaXNhYmxlICovCisgICAgICAgICAgICBwb3J0SW5mby0+ZmVhdHVyZVN0YXR1cyAmPSB+ZmVhdHVyZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIC8qIHJlc3RvcmUgcG9ydCBlbmFibGVkIHN0YXRlICovCisgICAgcG9ydEluZm8tPmVuYWJsZWQgPSBwb3J0RW5hYmxlZDsKKworICAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qKgorICogQGJyaWVmIHJldHVybnMgdGhlIHN0YXR1cyBvZiBhIGZlYXR1cmUKKyAqCisgKiBAcGFyYW0gcG9ydElEIHBvcnQgSUQKKyAqIEBwYXJhbSBwcmVzZW50I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VRIX0RCX0NIRUNLX1BPUlRfRVhJU1RTKHBvcnRJRCk7CisKKyAgICBJWF9FVEhfREJfQ0hFQ0tfUkVGRVJFTkNFKHR5cGUpOworCisgICAgSVhfRVRIX0RCX0NIRUNLX1JFRkVSRU5DRSh2YWx1ZSk7CisKKyAgICBpZiAoZmVhdHVyZSA9PSBJWF9FVEhfREJfVkxBTl9RT1MpCisgICAgeworICAgICAgICBpZiAocHJvcGVydHkgPT0gSVhfRVRIX0RCX1FPU19UUkFGRklDX0NMQVNTX0NPVU5UX1BST1BFUlRZKQorICAgICAgICB7CisgICAgICAgICAgICAqIChVSU5UMzIgKikgdmFsdWUgPSBpeEV0aERCUG9ydEluZm9bcG9ydElEXS5peEV0aERCVHJhZmZpY0NsYXNzQ291bnQ7CisgICAgICAgICAgICAqdHlwZSAgICAgICAgICAgICAgPSBJWF9FVEhfREJfSU5URUdFUl9QUk9QRVJUWTsKKworICAgICAgICAgICAgcmV0dXJuIElYX0VUSF9EQl9TVUNDRVNTOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHByb3BlcnR5ID49IElYX0VUSF9EQl9RT1NfVFJBRkZJQ19DTEFTU18wX1JYX1FVRVVFX1BST1BFUlRZCisgICAgICAgICAgICAmJiBwcm9wZXJ0eSA8PSBJWF9FVEhfREJfUU9TX1RSQUZGSUNfQ0xBU1NfN19SWF9RVUVVRV9QUk9QRVJUWSkKKyAgICAgICAgeworICAgICAgICAgICAgVUlOVDMyIGNsYXNzRGVsdGEgPSBwcm9wZXJ0eSAtIElYX0VUSF9EQl9RT1NfVFJBRkZJQ19DTEFTU18wX1JYX1FVRVVFX1BST1BFUlRZOworCisgICAgICAgICAgICBpZiAoY2xhc3NEZWx0YSA+PSBpeEV0aERCUG9ydEluZm9bcG9ydElEXS5peEV0aERCVHJhZmZpY0NsYXNzQ291bnQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0dXJuIElYX0VUSF9EQl9GQUlMOworICAgICAgICAgICAgf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lwZV0ocmVmZXJlbmNlLCBub2RlLT5kYXRhKSkKKyAgICAgICAgeworICAgICAgICAgICAgLyogZm91bmQgZW50cnkgKi8KKyAgICAgICAgICAgIGlmIChub2RlLT5uZXh0ICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgUFVTSF9MT0NLKCZsb2NrcywgJm5vZGUtPm5leHQtPmxvY2spOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAocHJldmlvdXNOb2RlID09IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogbm9kZSBpcyBoZWFkIG9mIGNoYWluICovCisgICAgICAgICAgICAgICAgUFVTSF9MT0NLKCZsb2NrcywgJmhhc2hUYWJsZS0+YnVja2V0TG9ja3NbYnVja2V0SW5kZXhdKTsKKworICAgICAgICAgICAgICAgIGhhc2hUYWJsZS0+aGFzaEJ1Y2tldHNbYnVja2V0SW5kZXhdID0gbm9kZS0+bmV4dDsKKworICAgICAgICAgICAgICAgIFBPUF9MT0NLKCZsb2Nrcyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogcmVsaW5rICovCisgICAgICAgICAgICAgICAgcHJldmlvdXNOb2RlLT5uZXh0ID0gbm9kZS0+bmV4dDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgVU5ST0xMX1NUQUNLKCZsb2Nrcyk7CisKKyAgICAgICAgICAgIC8qIGZyZWUgbm9kZSAqLworICAgICAgICAgICAgaGFzaFRhYmxlLT5mcmVlRnVuY3Rpb24obm9kZS0+ZGF0YSk7CisgICAgICAgICAgICBpeEV0aERCRnJlZUhhc2hOb2RlKG5vZGUpOworCisgICAgICAgICAgICByZXR1cm4gSVhfRVRIX0RCX1NVQ0NFU1M7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBpZiAocHJldmlvdXNOb2RlICE9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogdW5sb2NrIHByZXZpb3VzIG5vZGUgKi8KKyAgICAgICAgICAgICAgICBTSElGVF9TVEFDSygmbG9ja3MpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKiBhZHZhbmNlIHRvIG5leHQgZWxlbWVudCBpbiBjaGFpbiAqLworICAgICAgICAgICAgcHJldmlvdXNOb2RlID0gbm9kZTsKKyAgICAgICAgICAgIG5vZGUgICAgICAgICA9IG5vZGUtPm5leHQ7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBVTlJPTExfU1RBQ0soJmxvY2tzKTsKKworICAgIC8qIG5vdCBmb3VuZCAqLworICAgIHJldHVybiBJWF9FVEhfREJfTk9fU1VDSF9BRERSOworfQorCisvKioKKyAqIEBicmllZiByZXRyaWV2ZXMgYW4gZW50cnkgZnJvbSB0aGUgaGFzaCB0YWJsZQorICoKKyAqIEBwYXJhbSBoYXNoVGFibGUgaGFzaCB0YWJsZSB0byBwZXJmb3JtIHRoZSBzZWFyY2ggaW50bworICogQHBhcmFtIHJlZmVyZW5jZSBzZWFyY2gga2V5IChhIE1BQyBhZGRyZXNzKQorICogQHBhcmFtIGtleVR5cGUgdHlwZSBvZiByZWNvcmQga2V5IHVzZWQgZm9yIG1hdGNoaW5nCisgKiBAcGFyYW0gc2VhcmNoUmVzdWx0IHBvaW50ZXIgd2hlcmUgYSByZWZlcmVuY2UgdG8gdGhlIGxvY2F0ZWQgaGFzaCBub2RlIAorICogaXMgcGxhY2VkCisgKgorICogU2VhcmNoZXMgdGhlIGVudHJ5IHdpdGggdGhlIHNhbWUga2V5IGFzIDxpPnJlZmVyZW5jZTwvaT4gYW5kIHBsYWNlcyB0aGUKKyAqIHBvaW50ZXIgdG8gdGhlIHJlc3VsdGluZyBub2RlIGluIDxpPnNlYXJjaFJlc3VsdDwvaT4uCisgKiBBbiBpbXBsaWNpdCB3cml0ZSBhY2Nlc3MgbG9jayBpcyBncmFudGVkIGFmd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l0ZXJhdG9yLT5ub2RlLT5uZXh0OworCisgICAgICAgICAgICByZXR1cm4gSVhfRVRIX0RCX1NVQ0NFU1M7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvKiBsYXN0IGluIGNoYWluLCBwcmVwYXJlIGZvciBuZXh0IGJ1Y2tldCAqLworICAgICAgICAgICAgaXRlcmF0b3ItPmJ1Y2tldEluZGV4Kys7CisgICAgICAgIH0KKyAgICB9CisKKyAgIC8qIHRyeSBuZXh0IHVzZWQgYnVja2V0ICovCisgICAgZm9yICg7IGl0ZXJhdG9yLT5idWNrZXRJbmRleCA8IGhhc2hUYWJsZS0+bnVtQnVja2V0cyA7IGl0ZXJhdG9yLT5idWNrZXRJbmRleCsrKQorICAgIHsKKyAgICAgICAgSGFzaE5vZGUgKipub2RlUHRyID0gJihoYXNoVGFibGUtPmhhc2hCdWNrZXRzW2l0ZXJhdG9yLT5idWNrZXRJbmRleF0pOworICAgICAgICBIYXNoTm9kZSAqbm9kZSA9ICpub2RlUHRyOworI2lmIChDUFUhPVNJTVNQQVJDU09MQVJJUykgJiYgIWRlZmluZWQgKF9fd2luY2UpCisgICAgICAgIGlmICgoKGl0ZXJhdG9yLT5idWNrZXRJbmRleCAmIElYX0VUSERCX0JVQ0tFVF9JTkRFWF9NQVNLKSA9PSAwKSAmJgorICAgICAgICAgICAgKGl0ZXJhdG9yLT5idWNrZXRJbmRleCA8IChoYXNoVGFibGUtPm51bUJ1Y2tldHMgLSBJWF9FVEhEQl9CVUNLRVRQVFJfQUhFQUQpKSkKKyAgICAgICAgeworICAgICAgICAgICAgLyogcHJlbG9hZCBuZXh0IGNhY2hlIGxpbmUgKDIgY2FjaGUgbGluZSBhaGVhZCkgKi8KKyAgICAgICAgICAgIG5vZGVQdHIgKz0gSVhfRVRIREJfQlVDS0VUUFRSX0FIRUFEOworICAgICAgICAgICAgX19hc21fXyAoInBsZCBbJTBdO1xuIjogOiAiciIgKG5vZGVQdHIpKTsKKyAgICAgICAgfQorI2VuZGlmCisgICAgICAgIGlmIChub2RlICE9IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIFRSWV9MT0NLKCZub2RlLT5sb2NrKTsKKworICAgICAgICAgICAgLyogdW5sb2NrIGxhc3Qgb25lIG9yIHR3byBub2RlcyBpbiB0aGUgcHJldmlvdXMgY2hhaW4gKi8KKyAgICAgICAgICAgIGlmIChpdGVyYXRvci0+bm9kZSAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFVOTE9DSygmaXRlcmF0b3ItPm5vZGUtPmxvY2spOworCisgICAgICAgICAgICAgICAgaWYgKGl0ZXJhdG9yLT5wcmV2aW91c05vZGUgIT0gTlVMTCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIFVOTE9DSygmaXRlcmF0b3ItPnByZXZpb3VzTm9kZS0+bG9jayk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICAvKiByZWRpcmVjdCBpdGVyYXRvciAqLworICAgICAgICAgICAgaXRlcmF0b3ItPnByZXZpb3VzTm9kZSA9IE5VTEw7CisgICAgICAgICAgICBpdGVyYXRvci0+bm9kZSAgICAgICAgID0gbm9kZTsKKworICAgICAgICAgICAgcmV0dXJuIElYX0VUSF9EQl9TVUNDRVNTOworICAgICAgICB9CisgICAgfQorCisgICAgLyogY291bGQgbm90IGFkdmFuY2UgaXRlcmF0b3IgKi8KKyAgICBpZiAoaXRlcmF0b3ItPm5vZGUgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIFVOTE9DSygmaXRlcmF0b3ItPm5vZGUtPmxvY2spOworCisgICAgICAgIGlmIChpdGVyYXRvci0+cHJldmlvdXNOb2RlICE9IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIFVOTE9DSygmaXRlcmF0b3ItPnByZXZpb3VzTm9kZS0+bG9jayk7CisgICAgICAgIH0KKworICAgIC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LyogdHJ5IG5leHQgY2hhaW4gLSBkb24ndCBrbm93IHlldCBpZiB3ZSdsbCBmaW5kIGFueXRoaW5nICovCisgICAgICAgIG5leHRJdGVyYXRvclBvcy5ub2RlID0gTlVMTDsKKworICAgICAgICAvKiBpZiB3ZSBmaW5kIHNvbWV0aGluZyBpdCdzIGEgY2hhaW4gaGVhZCAqLworICAgICAgICBuZXh0SXRlcmF0b3JQb3MucHJldmlvdXNOb2RlID0gTlVMTDsKKworICAgICAgICAvKiBicm93c2UgdXAgaW4gdGhlIGJ1Y2tldHMgdG8gZmluZCBhIG5vbi1udWxsIGNoYWluICovCisgICAgICAgIHdoaWxlICgrK25leHRJdGVyYXRvclBvcy5idWNrZXRJbmRleCA8IGhhc2hUYWJsZS0+bnVtQnVja2V0cykKKyAgICAgICAgeworICAgICAgICAgICAgbmV4dEl0ZXJhdG9yUG9zLm5vZGUgPSBoYXNoVGFibGUtPmhhc2hCdWNrZXRzW25leHRJdGVyYXRvclBvcy5idWNrZXRJbmRleF07CisKKyAgICAgICAgICAgIGlmIChuZXh0SXRlcmF0b3JQb3Mubm9kZSAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIGZvdW5kIGEgbm9uLWVtcHR5IGNoYWluLCB0cnkgdG8gbG9jayBoZWFkICovCisgICAgICAgICAgICAgICAgUFVTSF9MT0NLKCZsb2NrcywgJm5leHRJdGVyYXRvclBvcy5ub2RlLT5sb2NrKTsKKworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgLyogcmVzdG9yZSBsaW5rcyBvdmVyIHRoZSB0by1iZS1kZWxldGVkIGl0ZW0gKi8KKyAgICBpZiAoaXRlcmF0b3ItPnByZXZpb3VzTm9kZSA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgLyogZmlyc3QgaW4gY2hhaW4sIGxvY2sgYnVja2V0ICovCisgICAgICAgIFBVU0hfTE9DSygmbG9ja3Ms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BhcmVzIHR3byBtYWMgYWRkcmVzc2VzCisgKgorICogQHBhcmFtIG1hYzEgZmlyc3QgbWFjIGFkZHJlc3MgdG8gY29tcGFyZQorICogQHBhcmFtIG1hYzIgc2Vjb25kIG1hYyBhZGRyZXNzIHRvIGNvbXBhcmUKKyAqIAorICogVGhpcyBjb21wYXJpc29uIHdvcmtzIGluIGEgc2ltaWxhciB3YXkgdG8gc3RyY21wLCBwcm9kdWNpbmcgc2ltaWxhciByZXN1bHRzLgorICogVXNlZCB0byBpbnNlcnQgdmFsdWVzIGtleWVkIG9uIG1hYyBhZGRyZXNzZXMgaW50byBiaW5hcnkgc2VhcmNoIHRyZWVzLgorICoKKyAqIEByZXR2YWwgLTEgaWYgbWFjMSA8IG1hYzIKKyAqIEByZXR2YWwgMCBpZiBtYTEgPT0gbWFjMgorICogQHJldHZhbCAxIGlmIG1hYzEgPiBtYWMyCisgKi8KK1VJTlQzMiBpeEV0aERCQWRkcmVzc0NvbXBhcmUoVUlOVDggKm1hYzEsIFVJTlQ4ICptYWMyKQoreworICAgIFVJTlQzMiBsb2NhbF9pbmRleDsKKworICAgIGZvciAobG9jYWxfaW5kZXggPSAwIDsgbG9jYWxfaW5kZXggPCBJWF9JRUVFODAzX01BQ19BRERSRVNTX1NJWkUgOyBsb2NhbF9pbmRleCsrKQorICAgIHsKKyAgICAgICAgaWYgKG1hYzFbbG9jYWxfaW5kZXhdID4gbWFjMltsb2NhbF9pbmRleF0pCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldHVybiAxOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKG1hYzFbbG9jYWxfaW5kZXhdIDwgbWFjMltsb2NhbF9pbmRleF0pCisgICAgICAgIHsKKyAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHJldHVybiAwOworfQorCmRpZmYgLS1naXQgYS9jcHUvaXhwL25wZS9JeEV0aERCTWVtLmMgYi9jcHUvaXhwL25wZS9JeEV0aERCT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jb21wb25lbnQKKyAqCisgKiBJbml0aWFsaXplcyB0aGUgaGFzaCB0YWJsZSBub2RlLCBtYWMgZGVzY3JpcHRvciBhbmQgbWFjIHRyZWUgbm9kZSBwb29scy4KKyAqIENhbGxlZCBhdCBpbml0aWFsaXphdGlvbiB0aW1lIGJ5IEByZWYgaXhFdGhEQkluaXQoKS4KKyAqCisgKiBAaW50ZXJuYWwKKyAqLworSVhfRVRIX0RCX1BVQkxJQwordm9pZCBpeEV0aERCSW5pdE1lbW9yeVBvb2xzKHZvaWQpCit7CisgICAgaW50IGxvY2FsX2luZGV4OworCisgICAgLyogSGFzaE5vZGUgcG9vbCAqLworICAgIGl4T3NhbE11dGV4SW5pdCgmbm9kZVBvb2xMb2NrKTsKKworICAgIGZvciAobG9jYWxfaW5kZXggPSAwIDsgbG9jYWxfaW5kZXggPCBOT0RFX1BPT0xfU0laRSA7IGxvY2FsX2luZGV4KyspCisgICAgeworICAgICAgICBIYXNoTm9kZSAqZnJlZU5vZGUgPSAmbm9kZVBvb2xBcmVhW2xvY2FsX2luZGV4XTsKKworICAgICAgICBmcmVlTm9kZS0+bmV4dEZyZWUgPSBub2RlUG9vbDsKKyAgICAgICAgbm9kZVBvb2wgICAgICAgICAgID0gZnJlZU5vZGU7CisgICAgfQorCisgICAgLyogTWFjRGVzY3JpcHRvciBwb29sICovCisgICAgaXhPc2FsTXV0ZXhJbml0KCZtYWNQb29sTG9jayk7CisKKyAgICBmb3IgKGxvY2FsX2luZGV4ID0gMCA7IGxvY2FsX2luZGV4IDwgTUFDX1BPT0xfU0laRSA7IGxvY2FsX2luZGV4KyspCisgICAgeworICAgICAgICBNYWNEZXNjcmlwdG9yICpmcmVlRGVzY3JpcHRvciA9ICZtYWNQb29sQXJlYVtsb2NhbF9pbmRleF07CisKKyAgICAgICAgZnJlZURlc2NyaXB0b3ItPm5leHRGcmVlID0gbWFjUG9vbDsKKyAgICAgICAgbWFjUG9vbCAgICAgICAgICAgICAgICAgID0gZnJlZURlc2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Q0tfTUFDX1BPT0w7Cit9CisKKy8qKgorICogQGJyaWVmIGZyZWVzIG9yIHJlZHVjZXMgdGhlIHVzYWdlIGNvdW50IG9mIGEgbWFjIGRlc2NyaXB0b3Igc21hcnQgcG9pbnRlcgorICoKKyAqIElmIHRoZSByZWZlcmVuY2UgY291bnQgcmVhY2hlcyAwIChzdHJ1Y3R1cmUgaXMgbm8gbG9uZ2VyIHVzZWQgYW55d2hlcmUpCisgKiB0aGVuIHRoZSBkZXNjcmlwdG9yIGlzIGZyZWVkIGJhY2sgaW50byB0aGUgcG9vbCB1c2luZyBpeEV0aERCUG9vbEZyZWVNYWNEZXNjcmlwdG9yKCkuCisgKgorICogQHNlZSBpeEV0aERCUG9vbEZyZWVNYWNEZXNjcmlwdG9yKCkKKyAqCisgKiBAaW50ZXJuYWwKKyAqLworSVhfRVRIX0RCX1BVQkxJQwordm9pZCBpeEV0aERCRnJlZU1hY0Rlc2NyaXB0b3IoTWFjRGVzY3JpcHRvciAqbWFjRGVzY3JpcHRvcikKK3sKKyAgICBpZiAobWFjRGVzY3JpcHRvciAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgTE9DS19NQUNfUE9PTDsKKworICAgICAgICBpZiAobWFjRGVzY3JpcHRvci0+cmVmQ291bnQgPiAwKQorICAgICAgICB7CisgICAgICAgICAgICBtYWNEZXNjcmlwdG9yLT5yZWZDb3VudC0tOworCisgICAgICAgICAgICBpZiAobWFjRGVzY3JpcHRvci0+cmVmQ291bnQgPT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBVTkxPQ0tfTUFDX1BPT0w7CisKKyAgICAgICAgICAgICAgICBpeEV0aERCUG9vbEZyZWVNYWNEZXNjcmlwdG9yKG1hY0Rlc2NyaXB0b3IpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIFVOTE9DS19NQUNfUE9PTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgf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E9IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2xvbmVkTWFjTm9kZS0+ZGVzY3JpcHRvciA9IGl4RXRoREJDbG9uZU1hY0Rlc2NyaXB0b3IobWFjTm9kZS0+ZGVzY3JpcHRvcik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gY2xvbmVkTWFjTm9kZTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorfQorCisjaWZuZGVmIE5ERUJVRworLyogRGVidWcgc3RhdGlzdGljYWwgZnVuY3Rpb25zIGZvciBtZW1vcnkgdXNhZ2UgKi8KKworZXh0ZXJuIEhhc2hUYWJsZSBkYkhhc2h0YWJsZTsKK2ludCBpeEV0aERCTnVtSGFzaEVsZW1lbnRzKHZvaWQpOworCitpbnQgaXhFdGhEQk51bUhhc2hFbGVtZW50cyh2b2lkKQoreyAgIAorICAgIFVJTlQzMiBidWNrZXRJbmRleDsKKyAgICBpbnQgbnVtRWxlbWVudHMgPSAwOworICAgIEhhc2hUYWJsZSAqaGFzaFRhYmxlID0gJmRiSGFzaHRhYmxlOworCisgICAgZm9yIChidWNrZXRJbmRleCA9IDAgOyBidWNrZXRJbmRleCA8IGhhc2hUYWJsZS0+bnVtQnVja2V0cyA7IGJ1Y2tldEluZGV4KyspCisgICAgeworICAgICAgICBpZiAoaGFzaFRhYmxlLT5oYXNoQnVja2V0c1tidWNrZXRJbmRleF0gIT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgICAgSGFzaE5vZGUgKm5vZGUgPSBoYXNoVGFibGUtPmhhc2hCdWNrZXRzW2J1Y2tldEluZGV4XTsKKworICAgICAgICAgICAgd2hpbGUgKG5vZGUgIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBudW1FbGVtZW50cysrOworCisgICAgICAgICAgICAgICAgbm9kZSA9IG5vZGUtPm5leHQ7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICByZXR1cm4gbnVtRWxlbWVudHM7Cit9CisKK1VJTlQzMiBpeEV0aERCU2VhcmNoVHJlZVVzYWdlR2V0KE1hY1RyZWVOb2RlICp0cmVlKQoreworICAgIGlmICh0cmVlID09IE5VTEwpCisgICAgeworICAgICAgICByZXR1cm4gMDsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgcmV0dXJuIDEgLyogdGhpcyBub2RlICovICsgaXhFdGhEQlNlYXJjaFRyZWVVc2FnZUdldCh0cmVlLT5sZWZ0KSArIGl4RXRoREJTZWFyY2hUcmVlVXNhZ2VHZXQodHJlZS0+cmlnaHQpOworICAgIH0KK30KKworaW50IGl4RXRoREJTaG93TWVtb3J5U3RhdHVzKHZvaWQpCit7CisgICAgTWFjRGVzY3JpcHRvciAqbWFjOworICAgIE1hY1RyZWVOb2RlICp0cmVlOworICAgIEhhc2hOb2RlICpub2RlOworCisgICAgaW50IG1hY0NvdW50ZXIgID0gMDsKKyAgICBpbnQgdHJlZUNvdW50ZXIgPSAwOworICAgIGludCBub2RlQ291bnRlciA9IDA7CisKKyAgICBpbnQgdG90YWxUcmVlVXNhZ2UgICAgICAgICAgICA9IDA7CisgICAgaW50IHRvdGFsRGVzY3JpcHRvclVzYWdlICAgICAgPSAwOworICAgIGludCB0b3RhbENsb25lRGVzY3JpcHRvclVzYWdlID0gMDsKKyAgICBpbnQgdG90YWxOb2RlVXNhZ2UgICAgICAgICAgICA9IDA7CisKKyAgICBVSU5UMzIgcG9ydEluZGV4OworCisgICAgTE9DS19OT0RFX1BPT0w7CisgICAgTE9DS19NQUNfUE9PTDsKKyAgICBMT0NLX1RSRUVfUE9PTDsKKworICAgIG1hYyAgPSBtYWNQb29sOworICAgIHRyZWUgPSB0cmVlUG9vbDsKKyAgICBub2RlID0gbm9kZVBvb2w7CisKKyAgICB3aGlsZSAobWFjICE9IE5VTEwpCisgICAgeworICAgICAgICBtYWNDb3VudGVyKys7CisKKyAgICAgICAgbWFjID0gbWFjLT5uZXh0RnJlZTsKKworICAgICAgICBpZiAobWFjQ291bnRlciA+IE1BQ19QT09MX1NJWkUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgd2hpbGUgKHRyZWUgIT0gTlVMTCkKKyAgICB7CisgICAgICAgIHRyZWVDb3VudGVyKys7CisKKyAgICAgICAgdHJlZSA9IHRyZWUtPm5leHRGcmVlOworCisgICAgICAgIGlmICh0cmVlQ291bnRlciA+IFRSRUVfUE9PTF9TSVpFKQorICAgICAgICB7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIHdoaWxlIChub2RlICE9IE5VTEwpCisgICAgeworICAgICAgICBub2RlQ291bnRlcisrOworCisgICAgICAgIG5vZGUgPSBub2RlLT5uZXh0RnJlZTsKKworICAgICAgICBpZiAobm9kZUNvdW50ZXIgPiBOT0RFX1BPT0xfU0laRSkKKyAgICAgICAgeworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBmb3IgKHBvcnRJbmRleCA9IDAgOyBwb3J0SW5kZXggPCBJWF9FVEhfREJfTlVNQkVSX09GX1BPUlRTIDsgcG9ydEluZGV4KyspCisgICAgeworICAgICAgICBpbnQgdHJlZVVzYWdlID0gaXhFdGhEQlNlYXJjaFRyZWVVc2FnZUdldChpeEV0aERCUG9ydEluZm9bcG9ydEluZGV4XS51cGRhdGVNZXRob2Quc2VhcmNoVHJlZSk7CisKKyAgICAgICAgdG90YWxUcmVlVXNhZ2UgICAgICAgICAgICArPSB0cmVlVXNhZ2U7CisgICAgICAgIHRvdGFsQ2xvbmVEZXNjcmlwdG9yVXNhZ2UgKz0gdHJlZVVzYWdlOyAvKiBlYWNoIHRyZWUgbm9kZSBjb250YWlucyBhIGRlc2NyaXB0b3IgKi8KKyAgICB9CisKKyAgICB0b3RhbE5vZGVVc2FnZSAgICAgICAgP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UG9vbDsKKworICAgICAgICB3aGlsZSAocmVmZXJlbmNlICE9IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIE1hY0Rlc2NyaXB0b3IgKmNvbXBhcmlzb24gPSByZWZlcmVuY2UtPm5leHRGcmVlOworCisgICAgICAgICAgICB3aGlsZSAoY29tcGFyaXNvbiAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChyZWZlcmVuY2UgPT0gY29tcGFyaXNvbikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHByaW50ZigiV2FybmluZzogcmVhY2hlZCBhIGR1cGxpY2F0ZSAoJXApLCBpbnZhbGlkIE1BQyBwb29sIHN0YXRlXG4iLCByZWZlcmVuY2UpOworCisgICAgICAgICAgICAgICAgICAgIHJldHVybiAxOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGNvbXBhcmlzb24gPSBjb21wYXJpc29uLT5uZXh0RnJlZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmVmZXJlbmNlID0gcmVmZXJlbmNlLT5uZXh0RnJlZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaW50ZigiTm8gZHVwbGljYXRlcyBmb3VuZCBpbiB0aGUgTUFDIHBvb2wgKHNhbml0eSBjaGVjayBvaylcbiIpOworCisgICAgcmV0dXJuIDA7Cit9CisKKyNlbmRpZiAvKiBOREVCVUcgKi8KKworLyoqCisgKiBAfSBFdGhNZW1vcnlNYW5hZ2VtZW50CisgKi8KZGlmZiAtLWdpdCBhL2NwdS9peHAvbnBlL0l4RXRoREJOUEVBZGFwdG9yLmMgYi9jcHUvaXhwL25wZS9JeEV0aERCTlBFQWRhcHRvci5jCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjExMmE0NmMKLS0tIC9kZXYvbnVsbAorKysgYi9jcHUvaXhwL25wZS9JeEV0aERCTlBFQWRhcHRvci5jCkBAIC0wL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AgICAgdXBkYXRlLT5ucGVVcGRhdGVab25lICAgPSBJWF9PU0FMX0NBQ0hFX0RNQV9NQUxMT0MoRlVMTF9FTFRfQllURV9TSVpFKTsKKyAgICAgICAgICAgIHVwZGF0ZS0+bnBlR3dVcGRhdGVab25lID0gSVhfT1NBTF9DQUNIRV9ETUFfTUFMTE9DKEZVTExfR1dfQllURV9TSVpFKTsKKyAgICAgICAgICAgIHVwZGF0ZS0+dmxhblVwZGF0ZVpvbmUgID0gSVhfT1NBTF9DQUNIRV9ETUFfTUFMTE9DKEZVTExfVkxBTl9CWVRFX1NJWkUpOworCisgICAgICAgICAgICBpZiAodXBkYXRlLT5ucGVVcGRhdGVab25lID09IE5VTEwKKyAgICAgICAgICAgICAgICB8fCB1cGRhdGUtPm5wZUd3VXBkYXRlWm9uZSA9PSBOVUxMCisgICAgICAgICAgICAgICAgfHwgdXBkYXRlLT52bGFuVXBkYXRlWm9uZSA9PSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIEVSUk9SX0xPRygiRmF0YWwgZXJyb3I6IElYX0FDQ19EUlZfRE1BX01BTExPQygpIHJldHVybmVkIE5VTEwsIG5vIE5QRSB1cGRhdGUgem9uZXMgYXZhaWxhYmxlXG4iKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBtZW1zZXQodXBkYXRlLT5ucGVVcGRhdGVab25lLCAwLCBGVUxMX0VMVF9CWVRFX1NJWkUpOworICAgICAgICAgICAgICAgIG1lbXNldCh1cGRhdGUtPm5wZUd3VXBkYXRlWm9uZSwgMCwgRlVMTF9HV19CWVRFX1NJWkUpOworICAgICAgICAgICAgICAgIG1lbXNldCh1cGRhdGUtPnZsYW5VcGRhdGVab25lLCAwLCBGVUxMX1ZMQU5fQllURV9TSVpFKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIHVudXNlZCAqLworICAgICAgICAgICAgdXBkYXRlLT5ucGVVcGRhdGVab25lICAgPSBOVUxMOworICAgICAgICAgICAgdXBkYXRlLT5ucGVHd1VwZGF0ZVpvbmUgPSBOVUxMOworICAgICAgICAgICAgdXBkYXRlLT52bGFuVXBkYXRlWm9uZSAgPSBOVUxMOworICAgICAgICB9CisgICAgfQorfQorCisvKioKKyAqIEBicmllZiBkZWFsbG9jYXRlcyB0aGUgTlBFIHVwZGF0ZSBhcmVhcyBmb3IgYWxsIHRoZSBwb3J0cworICoKKyAqIFRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIGF0IGNvbXBvbmVudCBkZS1pbml0aWFsaXphdGlvbiB0aW1lCisgKiBieSBAcmVmIGl4RXRoREJVbmxvYWQoKS4KKyAqCisgKiBAd2FybmluZyBkbyBub3QgY2FsbCBtYW51YWxseQorICoKKyAqIEBpbnRlcm5hbAorICovCitJWF9FVEhfREJfUFVCTElDCit2b2lkIGl4RXRoREJOUEVVcGRhdGVBcmVhc1VubG9hZCh2b2lkKQoreworICAgIFVJTlQzMiBwb3J0SW5kZXg7CisKKyAgICBmb3IgKHBvcnRJbmRleCA9IDAgOyBwb3J0SW5kZXggPCBJWF9FVEhfREJfTlVNQkVSX09GX1BPUlRTIDsgcG9ydEluZGV4KyspCisgICAgeworICAgICAgICBpZiAoaXhFdGhEQlBvcnREZWZpbml0aW9uc1twb3J0SW5kZXhdLnR5cGUgPT0gSVhfRVRIX05QRSkKKyAgICAgICAgeworICAgICAgICAgICAgSVhfT1NBTF9DQUNIRV9ETUFfRlJFRShpeEV0aERCUG9ydEluZm9bcG9ydEluZGV4XS51cGRhdGVNZXRob2QubnBlVXBkYXRlWm9uZSk7CisgICAgICAgICAgICBJWF9PU0FMX0NBQ0hFX0RNQV9GUkVFKGl4RXRoREJQb3J0SW5mb1twb3J0SW5kZXhdLnVwZGF0ZU1ldGhvZC5ucGVHd1VwZGF0ZVpvbmUpOworICAgICAgICAgICA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gICAgICAgZW50cnlQb3J0SUQgPSBJWF9FVEhfREJfTlBFX0xPR0lDQUxfSURfVE9fUE9SVF9JRChJWF9FREJfTlBFX05PREVfUE9SVF9JRChlbHROb2RlQWRkcmVzcykpOworCisgICAgICAgICAgICAvKiBjaGVjayBvbmx5IGFjdGl2ZSBlbnRyaWVzIGJlbG9uZ2luZyB0byB0aGlzIHBvcnQgKi8KKyAgICAgICAgICAgIGlmIChpeEV0aERCUG9ydEluZm9bcG9ydElEXS5hZ2luZ0VuYWJsZWQgJiYgSVhfRURCX05QRV9OT0RFX0FDVElWRShlbHROb2RlQWRkcmVzcykgJiYgKHBvcnRJRCA9PSBlbnRyeVBvcnRJRCkKKyAgICAgICAgICAgICAgICAmJiAoKGl4RXRoREJQb3J0RGVmaW5pdGlvbnNbcG9ydElEXS5jYXBhYmlsaXRpZXMgJiBJWF9FVEhfRU5UUllfQUdJTkcpID09IDApKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIHNlYXJjaCByZWNvcmQgKi8KKyAgICAgICAgICAgICAgICBIYXNoTm9kZSAqbm9kZSA9IGl4RXRoREJTZWFyY2goKEl4RXRoREJNYWNBZGRyICopIGVsdE5vZGVBZGRyZXNzLCBJWF9FVEhfREJfQUxMX0ZJTFRFUklOR19SRUNPUkRTKTsKKworICAgICAgICAgICAgICAgIC8qIHNhZmV0eSBjaGVjaywgbWF5YmUgdXNlciBkZWxldGVkIHJlY29yZCByaWdodCBiZWZvcmUgc3luYz8gKi8KKyAgICAgICAgICAgICAgICBpZiAobm9kZSAhPSBOVUxMKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyogZm91bmQgcmVjb3JkICovCisgICAgICAgICAgICAgICAgICAgIE1hY0Rlc2NyaXB0b3IgKmRlc2NyaXB0b3IgPSAoTWFjRGVzY3JpcHRvciAqKSBub2RlLT5kYXRhOworCisgICAgICAgICAgICAgICAgICAgIElYX0VUSF9EQl9OUEVfVkVSQk9TRV9UUkFDRSgiREI6IChOUEVBZGFwdG9yKSBzeW5jZWQgZW50cnkgWyVzXSBhbHJlYWR5IGluIHRoZSBkYXRhYmFzZSwgdXBkYXRpbmcgZmllbGRzXG4iLCBtYWMyc3RyaW5nKGVsdE5vZGVBZGRyZXNzKSk7CisKKyAgICAgICAgICAgICAgICAgICAgLyogcmVzZXQgYWdlIC0gc2V0IHRvIC0xIHNvIHRoYXQgbWFpbnRlbmFuY2Ugd2lsbCByZXN0b3JlIGl0IHRvIDAgKG9yIG1vcmUpIHdoZW4gaW5jcmVtZW50aW5nICovCisgICAgICAgICAgICAgICAgICAgIGlmICghZGVzY3JpcHRvci0+cmVjb3JkRGF0YS5maWx0ZXJpbmdEYXRhLnN0YXRpY0VudHJ5KQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGVzY3JpcHRvci0+dHlwZSA9PSBJWF9FVEhfREJfRklMVEVSSU5HX1JFQ09SRCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLmZpbHRlcmluZ0RhdGEuYWdlID0gQUdFX1JFU0VUOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZGVzY3JpcHRvci0+dHlwZSA9PSBJWF9FVEhfREJfRklMVEVSSU5HX1ZMQU5fUkVDT1JEKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPnJlY29yZERhdGEuZmlsdGVyaW5nVmxhbkRhdGEuYWdlID0gQUdFX1JFU0VUOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLyogZW5kIHRyYW5zYWN0aW9uICovCisgICAgICAgICAgICAgICAgICAgIGl4RXRoREJSZWxlY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ovCisgICAgSVhfT1NBTF9DQUNIRV9GTFVTSChiYXNlQWRkcmVzcywgdG90YWxTaXplKTsKKworICAgIC8qIGRlYnVnICovCisgICAgSVhfRVRIX0RCX05QRV9UUkFDRSgiREI6IChOUEVBZGFwdG9yKSBFdGhlcm5ldCBsZWFybmluZy9maWx0ZXJpbmcgdHJlZSBYU2NhbGUgd3JvdGUgYXQgYWRkcmVzcyAweCUwOFggKG1heCAlZCBieXRlcyk6XG5cbiIsCisgICAgICAgIChVSU5UMzIpIGJhc2VBZGRyZXNzLCBGVUxMX0VMVF9CWVRFX1NJWkUpOworCisgICAgSVhfRVRIX0RCX05QRV9EVU1QX0VMVChiYXNlQWRkcmVzcywgRlVMTF9FTFRfQllURV9TSVpFKTsKKyAgICAKKyAgICAvKiBjb21wdXRlIG51bWJlciBvZiA2NC1ieXRlIGJsb2NrcyAqLworICAgIGlmIChibG9ja3MgIT0gTlVMTCkKKyAgICB7CisgICAgICAgICpibG9ja3MgPSBtYXhPZmZzZXQgIT0gMCA/IDEgKyBtYXhPZmZzZXQgLyA4IDogMDsKKworICAgICAgICBJWF9FVEhfREJfTlBFX1RSQUNFKCJEQjogKE5QRUFkYXB0b3IpIFdyb3RlICVkIDY0LWJ5dGUgYmxvY2tzXG4iLCAqYmxvY2tzKTsKKyAgICB9CisgICAgCisgICAgLyogY29tcHV0ZSBlcERlbHRhIC0gc3RhcnQgaW5kZXggZm9yIGJpbmFyeSBzZWFyY2ggKi8KKyAgICBpZiAoZXBEZWx0YSAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgVUlOVDMyIGRlbHRhSW5kZXggPSAwOworCisgICAgICAgICplcERlbHRhID0gMDsKKyAgICAgICAgCisgICAgICAgIGZvciAoOyBkZWx0YUluZGV4IDwgSVhfRVRIX0RCX01BWF9ERUxUQV9aT05FUyA7IGRlbHRhSW5kZXggKyspCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChpeEV0aERCRVBEZWx0YU9mZnNldFt0eXBlXVtkZ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kZHJlc3MsIElYX0VUSF9EQl9BTExfUkVDT1JEX1RZUEVTKTsKKworICAgICAgICAgICAgICAgIHByaW50ZigiJXMgLSBwb3J0ICVkIC0gJXMgIiwgbWFjMnN0cmluZygodW5zaWduZWQgY2hhciAqKSBlbHROb2RlQWRkcmVzcyksIGVudHJ5UG9ydElELCAKKyAgICAgICAgICAgICAgICAgICAgSVhfRURCX05QRV9OT0RFX0FDVElWRShlbHROb2RlQWRkcmVzcykgPyAiYWN0aXZlIiA6ICJpbmFjdGl2ZSIpOworCisgICAgICAgICAgICAgICAgLyogc2FmZXR5IGNoZWNrLCBtYXliZSB1c2VyIGRlbGV0ZWQgcmVjb3JkIHJpZ2h0IGJlZm9yZSBzeW5jPyAqLworICAgICAgICAgICAgICAgIGlmIChub2RlICE9IE5VTEwpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBmb3VuZCByZWNvcmQgKi8KKyAgICAgICAgICAgICAgICAgICAgTWFjRGVzY3JpcHRvciAqZGVzY3JpcHRvciA9IChNYWNEZXNjcmlwdG9yICopIG5vZGUtPmRhdGE7CisKKyAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCItICVzICIsCisgICAgICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT50eXBlID09IElYX0VUSF9EQl9GSUxURVJJTkdfUkVDT1JEID8gImZpbHRlcmluZyIgOgorICAgICAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+dHlwZSA9PSBJWF9FVEhfREJfRklMVEVSSU5HX1ZMQU5fUkVDT1JEID8gInZsYW4iIDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPnR5cGUgPT0gSVhfRVRIX0RCX1dJRklfUkVDT1JEID8gIndpZmkiIDogIm90aGVyIChjaGVjayBtYWluIERCKSIpOworCisgICAgICAgICAgICAgICAgICAgIGlmIChkZXNjcmlwdG9yLT50eXBlID09IElYX0VUSF9EQl9GSUxURVJJTkdfUkVDT1JEKSBwcmludGYoIi0gYWdlICVkIC0gJXMgIiwgCisgICAgICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLmZpbHRlcmluZ0RhdGEuYWdlLAorICAgICAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+cmVjb3JkRGF0YS5maWx0ZXJpbmdEYXRhLnN0YXRpY0VudHJ5ID8gInN0YXRpYyIgOiAiZHluYW1pYyIpOworCisgICAgICAgICAgICAgICAgICAgIGlmIChkZXNjcmlwdG9yLT50eXBlID09IElYX0VUSF9EQl9GSUxURVJJTkdfVkxBTl9SRUNPUkQpIHByaW50ZigiLSBhZ2UgJWQgLSAlcyAtIHRjaSAlZCAiLAorICAgICAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+cmVjb3JkRGF0YS5maWx0ZXJpbmdWbGFuRGF0YS5hZ2UsCisgICAgICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLmZpbHRlcmluZ1ZsYW5EYXRhLnN0YXRpY0VudHJ5ID8gInN0YXRpYyIgOiAiZHluYW1pYyIsCisgICAgICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLmZpbHRlcmluZ1ZsYW5EYXRhLmllZWU4MDJfMXFUYWcpOworCisgICAgICAgICAgICAgICAgICAgIC8qIGVuZCB0cmFuc2FjdGlvbiAqLworICAgICAgICAgICAgICAgICAgICBpeEV0aERCUmVsZWFzZUhhc2hOb2RlKG5vZGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwcmludGYoIi0gbm90IHN5bmNlZCIpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHByaW50ZigiXG4iKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBpeE9zY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ICAgUG9ydEluZm8gKnBvcnQgICA9ICZpeEV0aERCUG9ydEluZm9bcG9ydEluZGV4XTsKKyAgICAgICAgQk9PTCBtYXBzQ29sbGlkZTsKKyAgICAgICAgCisgICAgICAgIE1BUFNfQ09MTElERShtYXBzQ29sbGlkZSwgdHJpZ2dlclBvcnRzLCBwb3J0LT5kZXBlbmRlbmN5UG9ydE1hcCk7CisKKyAgICAgICAgaWYgKG1hcHNDb2xsaWRlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBkbyB0cmlnZ2VycyBpbmZsdWVuY2UgdGhpcyBwb3J0PyAqLworICAgICAgICAgICAgJiYgIUlTX1BPUlRfSU5DTFVERUQocG9ydEluZGV4LCB1cGRhdGVQb3J0cykgIC8qIGFuZCBpdCdzIG5vdCBhbHJlYWR5IGluIHRoZSB1cGRhdGUgbGlzdCAqLworICAgICAgICAgICAgJiYgcG9ydC0+dXBkYXRlTWV0aG9kLnVwZGF0ZUVuYWJsZWQpICAgICAgICAgIC8qIGFuZCB3ZSdyZSBhbGxvd2VkIHRvIHVwZGF0ZSBpdCAqLworICAgICAgICB7CisgICAgICAgICAgICBJWF9FVEhfREJfVVBEQVRFX1RSQUNFKCJEQjogKFVwZGF0ZSkgQWRkaW5nIHBvcnQgJWQgdG8gdXBkYXRlIHNldFxuIiwgcG9ydEluZGV4KTsKKworICAgICAgICAgICAgSk9JTl9QT1JUX1RPX01BUCh1cGRhdGVQb3J0cywgcG9ydEluZGV4KTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIElYX0VUSF9EQl9VUERBVEVfVFJBQ0UoIkRCOiAoVXBkYXRlKSBEaWRuJ3QgYWRkIHBvcnQgJWQgdG8gdXBkYXRlIHNldCwgcmVhc29ucyBmb2xsb3c6XG4iLCBwb3J0SW5kZXgpOworCisgICAgICAgICAgICBpZiAoIW1hcHNDb2xsaWRlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIElYX0VUSF9EQl9VUERBVEVfVFJBQ0UoIlx0TWFwcyBkb24ndCBjb2xsaWRlIG9uIHBvcnQgJWRcbiIsIHBvcnRJbmRleCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChJU19QT1JUX0lOQ0xVREVEKHBvcnRJbmRleCwgdXBkYXRlUG9ydHMpKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIElYX0VUSF9EQl9VUERBVEVfVFJBQ0UoIlx0UG9ydCAlZCBpcyBhbHJlYWR5IGluIHRoZSB1cGRhdGUgc2V0XG4iLCBwb3J0SW5kZXgpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoIXBvcnQtPnVwZGF0ZU1ldGhvZC51cGRhdGVFbmFibGVkKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIElYX0VUSF9EQl9VUERBVEVfVFJBQ0UoIlx0UG9ydCAlZCBkb2Vzbid0IGhhdmUgdXBkYXRlRW5hYmxlZCBzZXRcbiIsIHBvcnRJbmRleCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgSVhfRVRIX0RCX1VQREFURV9UUkFDRSgiREI6IChVcGRhdGUpIFVwZGF0aW5nIHBvcnQgc2V0XG4iKTsKKworICAgIGl4RXRoREJDcmVhdGVUcmVlcyh1cGRhdGVQb3J0cyk7CisgICAgICAgIAorICAgIGl4RXRoREJVcGRhdGVVbmxvY2soKTsKK30KKworLyoqCisgKiBAYnJpZWYgY3JlYXRlcyBsZWFybmluZyB0cmVlcyBhbmQgY2FsbHMgdGhlIHBvcnQgdXBkYXRlIGhhbmRsZXJzCisgKgorICogQHBhcmFtIHVwZGF0ZVBvcnRzIHNldCBvZiBwb3J0cyBpbiBuZWVkIG9mIGxlYXJuaW5nIHRyZWVzCisgKgorICogVGhpcyBmdW5jdGlvbiBkZXRlcm1pbmVzIHRoZSBvcHRpbWFsIG1ldGhvZCBvZiBjcmVhdGluZyBsZWFybmluZworICogdHJl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QgbmVlZCB0aGVtICovCisgICAgICAgICAgICBpZiAoIXBvcnQtPnVwZGF0ZU1ldGhvZC5zZWFyY2hUcmVlUGVuZGluZ1dyaXRlICYmIElTX1BPUlRfSU5DTFVERUQocG9ydEluZGV4LCB1cGRhdGVQb3J0cykpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgR0VUX01BUF9TSVpFKHBvcnQtPmRlcGVuZGVuY3lQb3J0TWFwLCBzaXplKTsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBJWF9FVEhfREJfVVBEQVRFX1RSQUNFKCJEQjogKFVwZGF0ZSkgRGVwZW5kZW5jeSBtYXAgZm9yIHBvcnQgJWQ6IHNpemUgJWRcbiIsCisgICAgICAgICAgICAgICAgICAgIHBvcnRJbmRleCwgc2l6ZSk7CisKKyAgICAgICAgICAgICAgICBpZiAoc2l6ZSA8IG1pbmltYWxTaXplKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbWluUG9ydEluZGV4ID0gcG9ydEluZGV4OworICAgICAgICAgICAgICAgICAgICBtaW5pbWFsU2l6ZSAgPSBzaXplOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBJWF9FVEhfREJfVVBEQVRFX1RSQUNFKCJEQjogKFVwZGF0ZSkgU2tpcHBlZCBwb3J0ICVkIGZyb20gdHJlZSBkaWZmICglcylcbiIsIHBvcnRJbmRleCwKKyAgICAgICAgICAgICAgICAgICAgcG9ydC0+dXBkYXRlTWV0aG9kLnNlYXJjaFRyZWVQZW5kaW5nV3JpdGUgPyAicGVuZGluZyB3cml0ZSBhY2Nlc3MiIDogImlnbm9yZWQgYnkgcXVlcnkiKTsKKyAgICAgICAgICAgIH0gICAgICAgICAgICAKKyAgICAgICAgfQorCisgICAgICAgIC8qIGlmIGEgcG9ydCB3YXMgZm91bmQgdGhhbiBtaW5pbWFsU2l6ZSBpcyBub3QgTUFYX1BPUlRfU0laRSAqLworICAgICAgICBpZiAobWluaW1hbFNpemUgIT0gTUFYX1BPUlRfU0laRSkKKyAgICAgICAgeworICAgICAgICAgICAgLyogbWluUG9ydEluZGV4IGlzIHRoZSBwb3J0IHdlIHNlZWsgKi8KKyAgICAgICAgICAgIFBvcnRJbmZvICpwb3J0ID0gJml4RXRoREJQb3J0SW5mb1ttaW5Qb3J0SW5kZXhdOworCisgICAgICAgICAgICBJeEV0aERCUG9ydE1hcCBxdWVyeTsKKyAgICAgICAgICAgIE1hY1RyZWVOb2RlICpiYXNlVHJlZTsKKworICAgICAgICAgICAgLyogbm93IHRyeSB0byBmaW5kIGEgcG9ydCB3aXRoIG1pbmltYWwgbWFwIGRpZmZlcmVuY2UgKi8KKyAgICAgICAgICAgIFBvcnRJbmZvICptaW5pbWFsRGlmZlBvcnQgPSBOVUxMOworICAgICAgICAgICAgVUlOVDMyIG1pbmltYWxEaWZmICAgICAgICA9IE1BWF9QT1JUX1NJWkU7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIElYX0VUSF9EQl9VUERBVEVfVFJBQ0UoIkRCOiAoVXBkYXRlKSBNaW5pbWFsIHNpemUgcG9ydCBpcyAlZFxuIiwgbWluUG9ydEluZGV4KTsKKworICAgICAgICAgICAgZm9yIChwb3J0SW5kZXggPSAwIDsgcG9ydEluZGV4IDwgSVhfRVRIX0RCX05VTUJFUl9PRl9QT1JUUyA7IHBvcnRJbmRleCsrKQorICAgICAgICAgICAgeyAgIAorICAgICAgICAgICAgICAgIFBvcnRJbmZvICpkaWZmUG9ydCA9ICZpeEV0aERCUG9ydEluZm9bcG9ydEluZGV4XTsKKyAgICAgICAgICAgICAgICBCT09MIG1hcElzU3Vic2V0OworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIElTX01BUF9TVUJTRVQobWFwSXNTdWJzZXQsIGRpZmZQb3J0LT5kZXBlbmRlbmN5UG9ydE1hcCwgcG9ydC0+ZGVwZW5kZW5jeVBvcnRNYXApOworICAgICAgICAgICAgICAgIAorCisgICAgICAgICAgICAgICAgaWYgKHBvcnRJbmRleCAhPSBtaW5Qb3J0SW5kZXgKKyAgICAgICAgICAgICAgICAgICAgJiYgZGlmZlBvcnQtPnVwZGF0ZU1ldGhvZC5zZWFyY2hUcmVlICE9IE5VTEwKKyAgICAgICAgICAgICAgICAgICAgJiYgbWFwSXNTdWJzZXQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiBjb21wdXRlIHNpemUgYW5kIHBpY2sgb25seSBtaW5pbWFsIHNpemUgZGlmZmVyZW5jZSAqLworICAgICAgICAgICAgICAgICAgICBVSU5UMzIgZGlmZlBvcnRTaXplOworICAgICAgICAgICAgICAgICAgICBVSU5UMzIgc2l6ZURpZmZlcmVuY2U7CisKKyAgICAgICAgICAgICAgICAgICAgR0VUX01BUF9TSVpFKGRpZmZQb3J0LT5kZXBlbmRlbmN5UG9ydE1hcCwgZGlmZlBvcnRTaXplKTsKKyAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBJWF9FVEhfREJfVVBEQVRFX1RSQUNFKCJEQjogKFVwZGF0ZSkgQ2hlY2tpbmcgcG9ydCAlZCBmb3IgZGlmZmVyZW5jZXMuLi5cbiIsIHBvcnRJbmRleCk7CisKKyAgICAgICAgICAgICAgICAgICAgc2l6ZURpZmZlcmVuY2UgPSBtaW5pbWFsU2l6ZSAtIGRpZmZQb3J0U2l6ZTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoc2l6ZURpZmZlcmVuY2UgPCBtaW5pbWFsRGlmZikKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgbWluaW1hbERpZmZQb3J0ID0gZGlmZlBvcnQ7CisgICAgICAgICAgICAgICAgICAgICAgICBtaW5pbWFsRGlmZiAgICAgPSBzaXplRGlmZmVyZW5jZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgSVhfRVRIX0RCX1VQREFURV9UUkFDRSgiREI6IChVcGRhdGUpIE1pbmltYWwgZGlmZmVyZW5jZSAweCV4IHdhcyBmb3VuZCBvbiBwb3J0ICVkXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1pbmltYWxEaWZmLCBwb3J0SW5kZXgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKiBjaGVjayBpZiBmaWx0ZXJpbmcgaXMgZW5hYmxlZCBvbiB0aGlzIHBvcnQgKi8KKyAgICAgICAgICAgIGlmICgocG9ydC0+ZmVhdHVyZVN0YXR1cyAmIElYX0VUSF9EQl9GSUxURVJJTkcpICE9IDApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogaWYgbWluaW1hbERpZmYgaXMgbm90IE1BWF9QT1JUX1NJWkUgbWluaW1hbERpZmZQb3J0IHBvaW50cyB0byB0aGUgbW9zdCBzaW1pbGFyIHBvcnQgKi8KKyAgICAgICAgICAgICAgICBpZiAobWluaW1hbERpZmYgIT0gTUFYX1BPUlRfU0laRSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGJhc2VUcmVlID0gaXhFdGhEQkNsb25lTWFjVHJlZU5vZGUobWluaW1hbERpZmZQb3J0LT51cGRhdGVNZXRob2Quc2VhcmNoVHJlZSk7CisgICAgICAgICAgICAgICAgICAgIERJRkZfTUFQUyhxdWVyeSwgcG9ydC0+ZGVwZW5kZW5jeVBvcnRNYXAgLCBtaW5pbWFsRGlmZlBvcnQtPmRlcGVuZGVuY3lQb3J0TWFwKTsKKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIElYX0VUSF9EQl9VUERBVEVfVFJBQ0UoIkRCOiAoVXBkYXRlKSBGb3VuZCBtaW5pbWFsIGRpZmYsIGV4dGVuZGluZyB0cmVlICVkIG9uIHF1ZXJ5XG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgbWluaW1hbERpZmZQb3J0LT5wb3J0SUQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIC8qIC4uIG90aGVyd2lzZSBubyBzaW1pbGFyIHBvcnQgd2FzIGZvdW5kLCBidWlsZCB0cmVlIGZyb20gc2NyYXRjaCAqLworICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgYmFzZVRyZWUgPSBOVUxMOworICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgQ09QWV9ERVBFTkRFTkNZX01BUChxdWVyeSwgcG9ydC0+ZGVwZW5kZW5jeVBvcnRNYXApOworICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgSVhfRVRIX0RCX1VQREFURV9UUkFDRSgiREI6IChVcGRhdGUpIE5vIHNpbWlsYXIgZGlmZiwgY3JlYXRpbmcgdHJlZSBmcm9tIHF1ZXJ5XG4iKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBJU19FTVBUWV9ERVBFTkRFTkNZX01BUChyZXN1bHQsIHF1ZXJ5KTsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBpZiAoIXJlc3VsdCkgLyogb3RoZXJ3aXNlIHdlIGRvbid0IG5lZWQgYW55dGhpbmcgbW9yZSBvbiB0b3Agb2YgdGhlIGNsb25lZCB0cmVlICovCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBJWF9FVEhfREJfVVBEQVRFX1RSQUNFKCJEQjogKFVwZGF0ZSkgQWRkaW5nIHF1ZXJ5IHRyZWUgdG8gcG9ydCAlZFxuIiwgbWluUG9ydEluZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAvKiBidWlsZCBsZWFybmluZyB0cmVlICovCisgICAgICAgICAgICAgICAgICAgIHBvcnQtPnVwZGF0ZU1ldGhvZC5zZWFyY2hUcmVlID0gaXhFdGhEQlF1ZXJ5KGJhc2VUcmVlLCBxdWVyeSwgSVhfRVRIX0RCX0FMTF9GSUxURVJJTkdfUkVDT1JEUywgTUFYX0VMVF9TSVpFKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgSVhfRVRIX0RCX1VQREFURV9UUkFDRSgiREI6IChVcGRhdGUpIFF1ZXJ5IGlzIGVtcHR5LCBhc3N1bWluZyBpZGVudGljYWwgbmVhcmVzdCB0cmVlXG4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgcG9ydC0+dXBkYXRlTWV0aG9kLnNlYXJjaFRyZWUgPSBiYXNlVHJlZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogZmlsdGVyaW5nIGlzIG5vdCBlbmFibGVkLCB3aWxsIGRvd25sb2FkIGFuIGVtcHR5IHRyZWUgKi8KKyAgICAgICAgICAgICAgICBpZiAocG9ydC0+dXBkYXRlTWV0aG9kLnNlYXJjaFRyZWUgIT0gTlVMTCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGl4RXRoREJGcmVlTWFjVHJlZU5vZGUocG9ydC0+dXBkYXRlTWV0aG9kLnNlYXJjaFRyZWUpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHBvcnQtPnVwZGF0ZU1ldGhvZC5zZWFyY2hUcmVlID0gTlVMTDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyogbWFyayB0cmVlIGFzIHZhbGlkICovCisgICAgICAgICAgICBwb3J0LT51cGRhdGVNZXRob2Quc2VhcmNoVHJlZVBlbmRpbmdXcml0ZSA9IFRSVUU7CisgICAgICAg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VfTVNHKElYX0VUSF9EQl9QT1JUX0lEX1RPX05QRShwb3J0SUQpLCBtZXNzYWdlLCByZXN1bHQpOworCisgICAgICAgIGlmIChyZXN1bHQgPT0gSVhfU1VDQ0VTUykKKwl7CisgICAgICAgICAgICBJWF9FVEhfREJfVVBEQVRFX1RSQUNFKCJEQjogKFBvcnRVcGRhdGUpIEZpbmlzaGVkIGRvd25sb2FkaW5nIE5QRSB0cmVlIG9uIHBvcnQgJWRcbiIsIHBvcnRJRCk7CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBpeEV0aERCUG9ydEluZm9bcG9ydElEXS5hZ2luZ0VuYWJsZWQgICAgICAgICAgICAgICAgPSBGQUxTRTsKKyAgICAgICAgICAgIGl4RXRoREJQb3J0SW5mb1twb3J0SURdLnVwZGF0ZU1ldGhvZC51cGRhdGVFbmFibGVkICA9IEZBTFNFOworICAgICAgICAgICAgaXhFdGhEQlBvcnRJbmZvW3BvcnRJRF0udXBkYXRlTWV0aG9kLnVzZXJDb250cm9sbGVkID0gVFJVRTsKKworICAgICAgICAgICAgRVJST1JfTE9HKCJFdGhEQjogKFBvcnRVcGRhdGUpIGRpc2FibGluZyBhZ2luZyBhbmQgdXBkYXRlcyBvbiBwb3J0ICVkIChhc3N1bWVkIGRlYWQpXG4iLCBwb3J0SUQpOworCisgICAgICAgICAgICBpeEV0aERCRGF0YWJhc2VDbGVhcihwb3J0SUQsIElYX0VUSF9EQl9BTExfUkVDT1JEX1RZUEVTKTsKKworICAgICAgICAgICAgcmV0dXJuIElYX0VUSF9EQl9GQUlMOworICAgICAgICB9CisKKwlyZXR1cm4gSVhfRVRIX0RCX1NVQ0NFU1M7CisgICAgfQorICAgIGVsc2UgaWYgKHR5cGUgPT0gSVhfRVRIX0RCX0ZJUkVXQUxMX1JFQ09SRCkKKyAgICB7CisgICAgICAgIHJldHVybiBpeEV0aERCRmlyZXdhbGxVcGRhdGUocG9ydElELCBwb3J0LT51cGR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3JpcHRvcik7CisKKyAgICAgICAgICAgIElYX0VUSF9EQl9VUERBVEVfVFJBQ0UoIm1hdGNoXG4iKTsKKworICAgICAgICAgICAgaWYgKGRlc2NyaXB0b3JDbG9uZSAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIGFkZCBkZXNjcmlwdG9yIHRvIHRyZWUgKi8KKyAgICAgICAgICAgICAgICBzZWFyY2hUcmVlID0gaXhFdGhEQlRyZWVJbnNlcnQoc2VhcmNoVHJlZSwgZGVzY3JpcHRvckNsb25lKTsKKworICAgICAgICAgICAgICAgIGVudHJ5Q291bnQrKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIElYX0VUSF9EQl9VUERBVEVfVFJBQ0UoIm5vIG1hdGNoXG4iKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChlbnRyeUNvdW50IDwgbWF4RW50cmllcykKKyAgICAgICAgeworICAgICAgICAgICAgLyogYWR2YW5jZSB0byB0aGUgbmV4dCByZWNvcmQgKi8KKwkgICAgICAgIEJVU1lfUkVUUlkoaXhFdGhEQkluY3JlbWVudEhhc2hJdGVyYXRvcigmZGJIYXNodGFibGUsICZpdGVyYXRvcikpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyogdGhlIE5QRSB3b24ndCBhY2NlcHQgbW9yZSBlbnRyaWVzIHNvIHdlIGNhbiBzdG9wIG5vdyAqLworICAgICAgICAgICAgaXhFdGhEQlJlbGVhc2VIYXNoSXRlcmF0b3IoJml0ZXJhdG9yKTsKKworICAgICAgICAgICAgSVhfRVRIX0RCX1VQREFURV9UUkFDRSgiREI6IChQb3J0VXBkYXRlKSBudW1iZXIgb2YgZWxlbWVudHMgcmVhY2hlZCBtYXhpbXVtIHN1cHBvcnRlZCBieSBwb3J0XG4iKTsKKworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH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lID09IE5VTEwpCisgICAgeworICAgICAgICAvKiBvdXQgb2YgbWVtb3J5ICovCisgICAgICAgIEVSUk9SX0xPRygiV2FybmluZzogaXhFdGhEQkFsbG9jTWFjVHJlZU5vZGUgcmV0dXJuZWQgTlVMTCBpbiBmaWxlICVzOiVkIChvdXQgb2YgbWVtb3J5PylcbiIsIF9fRklMRV9fLCBfX0xJTkVfXyk7CisKKyAgICAgICAgaXhFdGhEQkZyZWVNYWNEZXNjcmlwdG9yKGRlc2NyaXB0b3IpOworCisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIC8qIHBvcHVsYXRlIG5vZGUgKi8KKyAgICBuZXdOb2RlLT5kZXNjcmlwdG9yID0gZGVzY3JpcHRvcjsKKworICAgIC8qIGFuIGVtcHR5IGluaXRpYWwgdHJlZSBpcyBhIHNwZWNpYWwgY2FzZSAqLworICAgIGlmIChzZWFyY2hUcmVlID09IE5VTEwpCisgICAgeworICAgICAgICByZXR1cm4gbmV3Tm9kZTsKKyAgICB9CisKKyAgICAvKiBnZXQgaW5zZXJ0aW9uIGxvY2F0aW9uICovCisgICAgd2hpbGUgKGluc2VydExvY2F0aW9uID09IE5VTEwpCisgICAgeworICAgICAgICBNYWNUcmVlTm9kZSAqbmV4dE5vZGU7CisKKyAgICAgICAgLyogY29tcGFyZSBnaXZlbiBrZXkgd2l0aCBjdXJyZW50IG5vZGUga2V5ICovCisgICAgICAgIGluc2VydFBvc2l0aW9uID0gaXhFdGhEQkFkZHJlc3NDb21wYXJlKGRlc2NyaXB0b3ItPm1hY0FkZHJlc3MsIGN1cnJlbnROb2RlLT5kZXNjcmlwdG9yLT5tYWNBZGRyZXNzKTsKKworICAgICAgICAvKiBuYXZpZ2F0ZSBkb3duICovCisgICAgICAgIGlmIChpbnNlcnRQb3NpdGlvbiA9PSBSSUdIVCkKKyAgICAgICAgeworICAgICAgICAgICAgbmV4dE5vZGUgPSBjdXJyZW50Tm9kZS0+cmlnaHQ7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoaW5zZXJ0UG9zaXRpb24gPT0gTEVGVCkKKyAgICAgICAgeworICAgICAgICAgICAgbmV4dE5vZGUgPSBjdXJyZW50Tm9kZS0+bGVmdDsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIGVycm9yLCBkdXBsaWNhdGUga2V5ICovCisgICAgICAgICAgICBFUlJPUl9MT0coIldhcm5pbmc6IHRyYXBwZWQgaW5zZXJ0aW9uIG9mIGEgZHVwbGljYXRlIE1BQyBhZGRyZXNzIGluIGFuIE5QRSBzZWFyY2ggdHJlZVxuIik7CisKKyAgICAgICAgICAgIC8qIHRoaXMgd2lsbCBmcmVlIHRoZSBNQUMgZGVzY3JpcHRvciBhcyB3ZWxsICovCisgICAgICAgICAgICBpeEV0aERCRnJlZU1hY1RyZWVOb2RlKG5ld05vZGUpOworCisgICAgICAgICAgICByZXR1cm4gc2VhcmNoVHJlZTsKKyAgICAgICAgfQorCisgICAgICAgIC8qIHdoZW4gd2UgY2FuIG5vIGxvbmdlciBkaXZlIHRocm91Z2ggdGhlIHRyZWUgd2UgZm91bmQgdGhlIGluc2VydGlvbiBwbGFjZSAqLworICAgICAgICBpZiAobmV4dE5vZGUgIT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgICAgY3VycmVudE5vZGUgPSBuZXh0Tm9kZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIGluc2VydExvY2F0aW9uID0gY3VycmVudE5vZGU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiBpbnNlcnQgbm9kZSAqLworICAgIGlmIChpbnNlcnRQb3NpdGlvbiA9PSBSSUdIVCkKKyAgICB7CisgICAgICAgIGluc2VydExvY2F0aW9uLT5yaWdodCA9IG5ld05vZGU7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIGluc2VydExvY2F0aW9uLT5sZWZ0ID0gbmV3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RhaWwgID0gcmVtYWluZGVyOworICAgICAgICAgICAgcmVtYWluZGVyID0gcmVtYWluZGVyLT5yaWdodDsKKyAgICAgICAgICAgICgqc2l6ZSkrKzsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIHJvdGF0ZSBhcm91bmQgcmVtYWluZGVyICovCisgICAgICAgICAgICB0ZW1wUHRyICAgICAgICAgPSByZW1haW5kZXItPmxlZnQ7CisgICAgICAgICAgICByZW1haW5kZXItPmxlZnQgPSB0ZW1wUHRyLT5yaWdodDsKKyAgICAgICAgICAgIHRlbXBQdHItPnJpZ2h0ICA9IHJlbWFpbmRlcjsKKyAgICAgICAgICAgIHJlbWFpbmRlciAgICAgICA9IHRlbXBQdHI7CisgICAgICAgICAgICB2aW5lVGFpbC0+cmlnaHQgPSB0ZW1wUHRyOworICAgICAgICB9CisgICAgfQorfQorCisvKioKKyAqIEBicmllZiBjb252ZXJ0cyBhIHZpbmUgaW50byBhIGJhbGFuY2VkIHRyZWUKKyAqCisgKiBAcGFyYW0gcm9vdCB2aW5lIHRvIGNvbnZlcnQKKyAqIEBwYXJhbSBzaXplIGRlcHRoIG9mIHZpbmUKKyAqCisgKiBAaW50ZXJuYWwKKyAqLworSVhfRVRIX0RCX1BSSVZBVEUKK3ZvaWQgaXhFdGhEQlJlYmFsYW5jZVZpbmVUb1RyZWUoTWFjVHJlZU5vZGUgKnJvb3QsIFVJTlQzMiBzaXplKQoreworICAgIFVJTlQzMiBsZWFmQ291bnQgPSBzaXplICsgMSAtICgxIDw8IGl4RXRoREJSZWJhbGFuY2VMb2cyRmxvb3Ioc2l6ZSArIDEpKTsKKworICAgIGl4RXRoREJSZWJhbGFuY2VDb21wcmVzc2lvbihyb290LCBsZWFmQ291bnQpOworCisgICAgc2l6ZSA9IHNpemUgLSBsZWFmQ291bnQ7CisKKyAgICB3aGlsZSAoc2l6ZSA+IDEpCisgICAgeworICAgICAgICBpeEV0aERCUmViYWxhbmNlQ29tcHJlc3Npb24ocm9vdCwgc2l6ZSAvIDIpOworCisgICAgICAgIHNpemUgLz0gMjsKKyAgICB9Cit9CisKKy8qKgorICogQGJyaWVmIGNvbXByZXNzZXMgYSB2aW5lL3RyZWUgc3RhZ2UgaW50byBhIG1vcmUgYmFsYW5jZWQgdmluZS90cmVlCisgKgorICogQHBhcmFtIHJvb3Qgcm9vdCBvZiB0aGUgdHJlZSB0byBjb21wcmVzcworICogQHBhcmFtIGNvdW50IG51bWJlciBvZiAic3BpbmUiIG5vZGVzCisgKgorICogQGludGVybmFsCisgKi8KK0lYX0VUSF9EQl9QUklWQVRFCit2b2lkIGl4RXRoREJSZWJhbGFuY2VDb21wcmVzc2lvbihNYWNUcmVlTm9kZSAqcm9vdCwgVUlOVDMyIGNvdW50KQoreworICAgIE1hY1RyZWVOb2RlICpzY2FubmVyID0gcm9vdDsKKyAgICBNYWNUcmVlTm9kZSAqY2hpbGQ7CisgICAgVUlOVDMyIGxvY2FsX2luZGV4OworCisgICAgZm9yIChsb2NhbF9pbmRleCA9IDAgOyBsb2NhbF9pbmRleCA8IGNvdW50IDsgbG9jYWxfaW5kZXgrKykKKyAgICB7CisgICAgICAgIGNoaWxkICAgICAgICAgID0gc2Nhbm5lci0+cmlnaHQ7CisgICAgICAgIHNjYW5uZXItPnJpZ2h0ID0gY2hpbGQtPnJpZ2h0OworICAgICAgICBzY2FubmVyICAgICAgICA9IHNjYW5uZXItPnJpZ2h0OworICAgICAgICBjaGlsZC0+cmlnaHQgICA9IHNjYW5uZXItPmxlZnQ7CisgICAgICAgIHNjYW5uZXItPmxlZnQgID0gY2hpbGQ7CisgICAgfQorfQorCisvKioKKyAqIEBicmllZiBjb21wdXRlcyB8X2xvZzIoeClffCAoYS5rLmEuIGZsb29yKGxvZzIoeCkpKQorICoKKyAqIEBwYXJhbSB4IG51bWJlciB0byBjb21wdXRlIHxfbG9nMih4KV98IGZvcgorICoKKyAqIEByZXR1cm4gfF9sb2cyKHgpX3wKK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eworICAgICAgICAgICAgbWFwTm9uZSAgID0gRkFMU0U7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmIChwb3J0SW5kZXggIT0gcG9ydElEKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG1hcFNlbGYgPSBGQUxTRTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgcHJpbnRmKCIlcyVkIiwgZmlyc3RQb3J0ID8gInsiIDogIiwgIiwgcG9ydEluZGV4KTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgZmlyc3RQb3J0ID0gRkFMU0U7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgaWYgKG1hcE5vbmUpCisgICAgeworICAgICAgICBtYXBTZWxmID0gRkFMU0U7CisgICAgfQorICAgIAorICAgIHByaW50ZigiJXMgKCVzKVxuIiwgZmlyc3RQb3J0ID8gIiIgOiAifSIsIG1hcFNlbGYgPyAic2VsZiIgOiBtYXBOb25lID8gIm5vbmUiIDogImdyb3VwIik7CisgICAgCisgICAgcmV0dXJuIElYX0VUSF9EQl9TVUNDRVNTOworfQorCisvKioKKyAqIEBicmllZiBkaXNwbGF5cyBhbGwgdGhlIGZpbHRlcmluZyByZWNvcmRzIGJlbG9uZ2luZyB0byBhIHBvcnQKKyAqCisgKiBAcGFyYW0gcG9ydElEIElEIG9mIHRoZSBwb3J0IHRvIGRpc3BsYXkKKyAqCisgKiBOb3RlIHRoYXQgdGhpcyBmdW5jdGlvbiBpcyBkb2N1bWVudGVkIGluIHRoZSBtYWluIGNvbXBvbmVudAorICogaGVhZGVyIGZpbGUsIEl4RXRoREIuaC4KKyAqCisgKiBAd2FybmluZyBkZXByZWNhdGVkLCB1c2UgQHJlZiBpeEV0aERCRmlsdGVyaW5nRGF0YWJhc2VTaG93UmVjb3JkcygpIAorICogaW5zdGVhZC4gQ2FsbGluZyB0aGlzIGZ1bmN0aW9uIGlzIGVxdWl2YWxlbnQgdG8gY2FsbGluZworICogaXhFdGhEQkZpbHRlcmluZ0RhdGFiYXNlU2hvd1JlY29yZHMocG9ydElELCBJWF9FVEhfREJfRklMVEVSSU5HX1JFQ09SRCkKKyAqLworSVhfRVRIX0RCX1BVQkxJQworSXhFdGhEQlN0YXR1cyBpeEV0aERCRmlsdGVyaW5nRGF0YWJhc2VTaG93KEl4RXRoREJQb3J0SWQgcG9ydElEKQoreworICAgIEl4RXRoREJTdGF0dXMgbG9jYWxfcmVzdWx0OworICAgIEhhc2hJdGVyYXRvciBpdGVyYXRvcjsKKyAgICBQb3J0SW5mbyAqcG9ydEluZm87CisgICAgVUlOVDMyIHJlY29yZENvdW50ID0gMDsKKworICAgIElYX0VUSF9EQl9DSEVDS19QT1JUKHBvcnRJRCk7CisKKyAgICBJWF9FVEhfREJfQ0hFQ0tfU0lOR0xFX05QRShwb3J0SUQpOworCisgICAgcG9ydEluZm8gPSAmaXhFdGhEQlBvcnRJbmZvW3BvcnRJRF07CisKKyAgICAvKiBkaXNwbGF5IHRhYmxlIGhlYWRlciAqLworICAgIHByaW50ZigiRXRoZXJuZXQgZGF0YWJhc2UgcmVjb3JkcyBmb3IgcG9ydCBJRCBbJWRdXG4iLCBwb3J0SUQpOworICAgIAorICAgIGl4RXRoREJEZXBlbmRlbmN5UG9ydE1hcFNob3cocG9ydElELCBwb3J0SW5mby0+ZGVwZW5kZW5jeVBvcnRNYXApOworICAgIAorICAgIGlmIChpeEV0aERCUG9ydERlZmluaXRpb25zW3BvcnRJRF0udHlwZSA9PSBJWF9FVEhfTlBFKQorICAgIHsKKyAgICAgICAgcHJpbnRmKCJOUEUgdXBkYXRlcyBhcmUgJXNcblxuIiwgcG9ydEluZm8tPnVwZGF0ZU1ldGhvZC51cGRhdGVFbmFibGVkID8gImVuYWJsZWQiIDogImRpc2FibGVkIik7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHByaW50ZigidXBkYXRlcyBkaXNhYmxlZCAobm90IGFuIE5QRSlcblxuIik7CisgICAgfQorCisgICAgcHJpbnRmKCIgICAgTUFDIGFkZHJlc3MgICAgfCAgIEFnZSAgfCBUeXBlIFxuIik7CisgICAgcHJpbnRmKCJfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX1xuIik7CisKKyAgICAvKiBicm93c2UgZGF0YWJhc2UgKi8KKyAgICBCVVNZX1JFVFJZKGl4RXRoREJJbml0SGFzaEl0ZXJhdG9yKCZkYkhhc2h0YWJsZSwgJml0ZXJhdG9yKSk7CisKKyAgICB3aGlsZSAoSVNfSVRFUkFUT1JfVkFMSUQoJml0ZXJhdG9yKSkKKyAgICB7CisgICAgICBNYWNEZXNjcmlwdG9yICpkZXNjcmlwdG9yID0gKE1hY0Rlc2NyaXB0b3IgKikgaXRlcmF0b3Iubm9kZS0+ZGF0YTsKKworICAgICAgaWYgKGRlc2NyaXB0b3ItPnBvcnRJRCA9PSBwb3J0SUQgJiYgZGVzY3JpcHRvci0+dHlwZSA9PSBJWF9FVEhfREJfRklMVEVSSU5HX1JFQ09SRCkKKyAgICAgIHsKKyAgICAgICAgICByZWNvcmRDb3VudCsrOworCisgICAgICAgICAgLyogZGlzcGxheSBlbnRyeSAqLworICAgICAgICAgIHByaW50ZigiICUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWDolMDJYIHwgJTVkICB8ICVzXG4iLAorICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzBdLAorICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzFdLAorICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzJdLAorICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzNdLAorICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzRdLAorICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzVdLAorICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLmZpbHRlc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XB0b3ItPm1hY0FkZHJlc3NbMV0sCisgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1syXSwKKyAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzNdLAorICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbNF0sCisgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1s1XSwKKyAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLmZpbHRlcmluZ0RhdGEuYWdlLAorICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPnJlY29yZERhdGEuZmlsdGVyaW5nRGF0YS5zdGF0aWNFbnRyeSA/ICJzdGF0aWMiIDogImR5bmFtaWMiKTsKKyAgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAocmVjb3JkRmlsdGVyID09IElYX0VUSF9EQl9GSUxURVJJTkdfUkVDT1JEKQorICAgIHsKKyAgICAgICAgLyogZGlzcGxheSBmaWx0ZXJpbmcgcmVjb3JkIGhlYWRlciAtIGxlYXZlIHRoaXMgY29tbWVudGVkIGNvZGUgaW4gcGxhY2UsIGl0cyBwdXJwb3NlIGlzIHRvIGFsaWduIHRoZSBwcmludCBmb3JtYXQgd2l0aCB0aGUgaGVhZGVyCisgICAgICAgIHByaW50ZigiICAgIE1BQyBhZGRyZXNzICAgIHwgICBBZ2UgIHwgICBUeXBlICAgXG4iKTsKKyAgICAgICAgcHJpbnRmKCJfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19cbiIpOyAgKi8KKworICAgICAgICBpZiAoZGVzY3JpcHRvci0+dHlwZSA9PSBJWF9FVEhfREJfRklMVEVSSU5HX1JFQ09SRCkKKyAgICAgICAgeworICAgICAgICAgcHJpbnRmKCIlMDJYOiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWCB8ICUzZCB8ICVzIFxuIiwKKyAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzBdLAorICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMV0sCisgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1syXSwKKyAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzNdLAorICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbNF0sCisgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1s1XSwKKyAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLmZpbHRlcmluZ0RhdGEuYWdlLAorICAgICAgICAgICAgIGRlc2NyaXB0b3ItPnJlY29yZERhdGEuZmlsdGVyaW5nRGF0YS5zdGF0aWNFbnRyeSA/ICJzdGF0aWMiIDogImR5bmFtaWMiKTsKKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlIGlmIChyZWNvcmRGaWx0ZXIgPT0gSVhfRVRIX0RCX1dJRklfUkVDT1JEKQorICAgIHsKKyAgICAgICAgLyogZGlzcGxheSBXaUZpIHJlY29yZCBoZWFkZXIgLSBsZWF2ZSB0aGlzIGNvbW1lbnRlZCBjb2RlIGluIHBsYWNlLCBpdHMgcHVycG9zZSBpcyB0byBhbGlnbiB0aGUgcHJpbnQgZm9ybWF0IHdpdGggdGhlIGhlYWRlciAKKyAgICAgICAgcHJpbnRmKCIgICAgTUFDIGFkZHJlc3MgICAgfCAgIEdXIE1BQyBhZGRyZXNzICBcbiIpOworICAgICAgICBwcmludGYoIl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX1xuIik7ICovCisKKyAgICAgICAgaWYgKGRlc2NyaXB0b3ItPnR5cGUgPT0gSVhfRVRIX0RCX1dJRklfUkVDT1JEKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoZGVzY3JpcHRvci0+cmVjb3JkRGF0YS53aWZpRGF0YS50eXBlID09IElYX0VUSF9EQl9XSUZJX0FQX1RPX0FQKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIGdhdGV3YXkgYWRkcmVzcyBwcmVzZW50ICovCisgICAgICAgICAgICAgICAgcHJpbnRmKCIlMDJYOiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWCB8ICUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWDolMDJYIFxuIiwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1swXSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1sxXSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1syXSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1szXSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1s0XSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1s1XSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+cmVjb3JkRGF0YS53aWZpRGF0YS5nd01hY0FkZHJlc3NbMF0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPnJlY29yZERhdGEud2lmaURhdGEuZ3dNYWNBZGRyZXNzWzFdLAorICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLndpZmlEYXRhLmd3TWFjQWRkcmVzc1syXSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+cmVjb3JkRGF0YS53aWZpRGF0YS5nd01hY0FkZHJlc3NbM10sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPnJlY29yZERhdGEud2lmaURhdGEuZ3dNYWNBZGRyZXNzWzRdLAorICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLndpZmlEYXRhLmd3TWFjQWRkcmVzc1s1XSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogbm8gZ2F0ZXdheSAqLworICAgICAgICAgICAgICAgIHByaW50ZigiJTAyWDolMDJYOiUwMlg6JTAyWDolMDJYOiUwMlggfCAtLS0tbm8gZ2F0ZXdheS0tLS0tIFxuIiwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1swXSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1sxXSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1syXSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1szXSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1s0XSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1s1XSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZSBpZiAocmVjb3JkRmlsdGVyID09IElYX0VUSF9EQl9GSVJFV0FMTF9SRUNPUkQpCisgICAgeworICAgICAgICAvKiBkaXNwbGF5IEZpcmV3YWxsIHJlY29yZCBoZWFkZXIgLSBsZWF2ZSB0aGlzIGNvbW1lbnRlZCBjb2RlIGluIHBsYWNlLCBpdHMgcHVycG9zZSBpcyB0byBhbGlnbiB0aGUgcHJpbnQgZm9ybWF0IHdpdGggdGhlIGhlYWRlciAKKyAgICAgICAgcHJpbnRmKCIgICAgTUFDIGFkZHJlc3MgICBcbiIpOworICAgICAgICBwcmludGYoIl9fX19fX19fX19fX19fX19fX1xuIik7ICovCisKKyAgICAgICAgaWYgKGRlc2NyaXB0b3ItPnR5cGUgPT0gSVhfRVRIX0RCX0ZJUkVXQUxMX1JFQ09SRCkKKyAgICAgICAgeworICAgICAgICAgICAgcHJpbnRmKCIlMDJYOiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWCBcbiIsCisgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1swXSwKKyAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzFdLAorICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMl0sCisgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1szXSwKKyAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzRdLAorICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbNV0pOworICAgICAgICB9CisgICAgfQorICAgIGVsc2UgaWYgKHJlY29yZEZpbHRlciA9PSBJWF9FVEhfREJfQUxMX1JFQ09SRF9UWVBFUykKKyAgICB7CisgICAgICAgIC8qIGRpc3BsYXkgY29tcG9zaXRlIHJlY29yZCBoZWFkZXIgLSBsZWF2ZSB0aGlzIGNvbW1lbnRlZCBjb2RlIGluIHBsYWNlLCBpdHMgcHVycG9zZSBpcyB0byBhbGlnbiB0aGUgcHJpbnQgZm9ybWF0IHdpdGggdGhlIGhlYWRlciAKKyAgICAgICAgcHJpbnRmKCIgICAgTUFDIGFkZHJlc3MgICB8IFJlY29yZCB8IEFnZXwgIFR5cGUgICB8IFZMQU4gfENGSXwgUW9TIHwgIEdXIE1BQyBhZGRyZXNzICAgXG4iKTsKKyAgICAgICAgcHJpbnRmKCJfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXG4iKTsgKi8KKworICAgICAgICBpZiAoZGVzY3JpcHRvci0+dHlwZSA9PSBJWF9FVEhfREJfRklMVEVSSU5HX1ZMQU5fUkVDT1JEKQorICAgICAgICB7CisgICAgICAgICAgICBwcmludGYoIiU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wdG9yLT50eXBlID09IElYX0VUSF9EQl9GSUxURVJJTkdfUkVDT1JEKQorICAgICAgICAgeworICAgICAgICAgICAgcHJpbnRmKCIlMDJYOiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWCB8IEZpbHRlciB8ICUyZCB8ICVzIHwgLS0tLSB8IC0gfCAtLS0gfCAtLS0tLS0tLS0tLS0tLS0tLVxuIiwKKyAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzBdLAorICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMV0sCisgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1syXSwKKyAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzNdLAorICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbNF0sCisgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1s1XSwKKyAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLmZpbHRlcmluZ0RhdGEuYWdlLAorICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPnJlY29yZERhdGEuZmlsdGVyaW5nRGF0YS5zdGF0aWNFbnRyeSA/ICJzdGF0aWMgIiA6ICJkeW5hbWljIik7CisgICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKGRlc2NyaXB0b3ItPnR5cGUgPT0gSVhfRVRIX0RCX1dJRklfUkVDT1JEKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAoZGVzY3JpcHRvci0+cmVjb3JkRGF0YS53aWZpRGF0YS50eXBlID09IElYX0VUSF9EQl9XSUZJX0FQX1RPX0FQKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIGdhdGV3YXkgYWRkcmVzcyBwcmVzZW50ICovCisgICAgICAgICAgICAgICAgcHJpbnRmKCIlMDJYOiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWCB8ICBXaUZpICB8IC0tIHwgQVA9PkFQICB8IC0tLS0gfCAtIHwgLS0tIHwgJTAyWDolMDJYOiUwMlg6JTAyWDolMDJYOiUwMlhcbiIsCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMF0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMV0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMl0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbM10sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbNF0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbNV0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPnJlY29yZERhdGEud2lmaURhdGEuZ3dNYWNBZGRyZXNzWzBdLAorICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLndpZmlEYXRhLmd3TWFjQWRkcmVzc1sxXSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+cmVjb3JkRGF0YS53aWZpRGF0YS5nd01hY0FkZHJlc3NbMl0sCisgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPnJlY29yZERhdGEud2lmaURhdGEuZ3dNYWNBZGRyZXNzWzNdLAorICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5yZWNvcmREYXRhLndpZmlEYXRhLmd3TWFjQWRkcmVzc1s0XSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+cmVjb3JkRGF0YS53aWZpRGF0YS5nd01hY0FkZHJlc3NbNV0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIG5vIGdhdGV3YXkgKi8KKyAgICAgICAgICAgICAgICBwcmludGYoIiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWDolMDJYIHwgIFdpRmkgIHwgLS0gfCBBUD0+U1QgIHwgLS0tLSB8IC0gfCAtLS0gfCAtLSBubyBnYXRld2F5IC0tIFxuIiwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1swXSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1sxXSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1syXSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1szXSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1s0XSwKKyAgICAgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1s1XSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZSBpZiAoZGVzY3JpcHRvci0+dHlwZSA9PSBJWF9FVEhfREJfRklSRVdBTExfUkVDT1JEKQorICAgICAgICB7CisgICAgICAgICAgICBwcmludGYoIiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWDolMDJYIHwgICBGVyAgIHwgLS0gfCAtLS0tLS0tIHwgLS0tLSB8IC0gfCAtLS0gfCAtLS0tLS0tLS0tLS0tLS0tLVxuIiwKKyAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzBdLAorICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbMV0sCisgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1syXSwKKyAgICAgICAgICAgICAgICBkZXNjcmlwdG9yLT5tYWNBZGRyZXNzWzNdLAorICAgICAgICAgICAgICAgIGRlc2NyaXB0b3ItPm1hY0FkZHJlc3NbNF0sCisgICAgICAgICAgICAgICAgZGVzY3JpcHRvci0+bWFjQWRkcmVzc1s1XSk7CisgICAgICAgIH0KKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgcHJpbnRmKCJpbnZhbGlkIHJlY29yZCBmaWx0ZXJcbiIpOworICAgIH0KK30KKworLyoqCisgKiBAYnJpZWYgZGlzcGxheXMgdGhlIHN0YXR1cywgcmVjb3JkcyBhbmQgY29uZmlndXJhdGlvbiBpbmZvcm1hdGlvbiBvZiBhIHBvcnQKKyAqCisgKiBAcGFyYW0gcG9ydElEIElEIG9mIHRoZSBwb3J0CisgKiBAcGFyYW0gcmVjb3JkRmlsdGVyIHJlY29yZCBmaWx0ZXIgdG8gZGlzcGxheQorICoKKyAqIEBpbnRlcm5hbAorICovCitJWF9FVEhfREJfUFJJVkFURQordm9pZCBpeEV0aERCUG9ydEluZm9TaG93KEl4RXRoREJQb3J0SWQgcG9ydElELCBJeEV0aERCUmVjb3JkVHlwZSByZWNvcmRGaWx0ZXIpCit7CisgICAgUG9ydEluZm8gKnBvcnRJbmZvID0gJml4RXRoREJQb3J0SW5mb1twb3J0SURdOworICAgIFVJTlQzMiByZWNvcmRDb3VudCA9IDA7CisgICAgSGFzaEl0ZXJhdG9yIGl0ZXJhdG9yOworICAgIEl4RXRoREJTdGF0dXMgbG9jYWxfcmVzdWx0OworCisgICAgLyogZGlzcGxheSBwb3J0IHN0YXR1cyAqLworICAgIHByaW50ZigiPT0gUG9ydCBJRCAlZCA9PVxuIiwgcG9ydElEKTsKKworICAgIC8qIGRpc3BsYXkgY2FwYWJpbGl0aWVzICovCisgICAgcHJpbnRmKCItIENhcGFiaWxpdGllczogIik7CisKKyAgICBpZiAoKHBvcnRJbmZvLT5mZWF0dXJlQ2FwYWJpbGl0eSAmIElYX0VUSF9EQl9MRUFSTklORykgIT0gMCkKKyAgICB7CisgICAgICAgIHByaW50ZigiTGVhcm5pbmcgKCVzKSAiLCAoKHBvcnRJbmZvLT5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KSA/ICJvbiIgOiAib2ZmIik7CisgICAgfQorCisgICAgcHJpbnRmKCJcbiIpOworCisgICAgLyogZGVwZW5kZW5jeSBtYXAgKi8KKyAgICBpeEV0aERCRGVwZW5kZW5jeVBvcnRNYXBTaG93KHBvcnRJRCwgcG9ydEluZm8tPmRlcGVuZGVuY3lQb3J0TWFwKTsKKworICAgIC8qIE5QRSBkeW5hbWljIHVwZGF0ZXMgKi8KKyAgICBpZiAoaXhFdGhEQlBvcnREZWZpbml0aW9uc1twb3J0SURdLnR5cGUgPT0gSVhfRVRIX05QRSkgCisgICAgeworICAgICAgICBwcmludGYoIiAtIE5QRSBkeW5hbWljIHVwZGF0ZSBpcyAlc1xuIiwgcG9ydEluZm8tPnVwZGF0ZU1ldGhvZC51cGRhdGVFbmFibGVkID8gImVuYWJsZWQiIDogImRpc2FibGVkIik7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHByaW50ZigiIC0gZHluYW1pYyB1cGRhdGUgZGlzYWJsZWQgKG5vdCBhbiBOUEUpXG4iKTsKKyAgICB9CisKKyAgICBpZiAoKHBvcnRJbmZvLT5mZWF0dXJlQ2FwYWJpbGl0eSAmIElYX0VUSF9EQl9XSUZJX0hFQURFUl9DT05WRVJTSU9OKSAhPSAwKQorICAgIHsKKyAgICAgICAgaWYgKChwb3J0SW5mby0+ZmVhdHVyZVN0YXR1cyAmIElYX0VUSF9EQl9XSUZJX0hFQURFUl9DT05WRVJTSU9OKSAhPSAwKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBXaUZpIGhlYWRlciBjb252ZXJzaW9uICovCisgICAgICAgICAgICBpZiAoKHBvcnRJbmZvLT5mcmFtZUNvbnRyb2xEdXJhdGlvbklEIAorICAgICAgICAgICAgICAgICsgcG9ydEluZm8tPmJic2lkWzBdIAorICAgICAgICAgICAgICAgICsgcG9ydEluZm8tPmJic2lkWzFdIAorICAgICAgICAgICAgICAgICsgcG9ydEluZm8tPmJic2lkWzJdIAorICAgICAgICAgICAgICAgICsgcG9ydEluZm8tPmJic2lkWzNdIAorICAgICAgICAgICAgICAgICsgcG9ydEluZm8tPmJic2lkWzRdIAorICAgICAgICAgICAgICAgICsgcG9ydEluZm8tPmJic2lkWzVdKSA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHByaW50ZigiIC0gV2lGaSBoZWFkZXIgY29udmVyc2lvbiBub3QgY29uZmlndXJlZFxuIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7ICAKKyAgICAgICAgICAgICAgICBwcmludGYoIiAtIFdpRmkgaGVhZGVyIGNvbnZlcnNpb246IEJCU0lEIFslMDJYOiUwMlg6JTAyWDolMDJYOiUwMlg6JTAyWF0sIEZyYW1lIENvbnRyb2wgMHglWCwgRHVyYXRpb24vSUQgMHglWFxuIiwgCisgICAgICAgICAgICAgICAgICAgIHBvcnRJbmZvLT5iYnNpZFswXSwKKyAgICAgICAgICAgICAgICAgICAgcG9ydEluZm8tPmJic2lkWzFdLAorICAgICAgICAgICAgICAgICAgICBwb3J0SW5mby0+YmJzaWRbMl0sCisgICAgICAgICAgICAgICAgICAgIHBvcnRJbmZvLT5iYnNpZFszXSwKKyAgICAgICAgICAgICAgICAgICAgcG9ydEluZm8tPmJic2lkWzRdLAorICAgICAgICAgICAgICAgICAgICBwb3J0SW5mby0+YmJzaWRbNV0sCisgICAgICAgICAgICAgICAgICAgIHBvcnRJbmZvLT5mcmFtZUNvbnRyb2xEdXJhdGlvbklEID4+IDE2LAorICAgICAgICAgICAgICAgICAgICBwb3J0SW5mby0+ZnJhbWVDb250cm9sRHVyYXRpb25JRCAmIDB4RkZGRik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICBwcmludGYoIiAtIFdpRmkgaGVhZGVyIGNvbnZlcnNpb24gbm90IGVuYWJsZWRcbiIpOworICAgICAgICB9CisgICAgfQorCisgICAgLyogRmlyZ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ICAgICAgIHsKKyAgICAgICAgICAgIE1hY0Rlc2NyaXB0b3IgKmRlc2NyaXB0b3IgPSAoTWFjRGVzY3JpcHRvciAqKSBpdGVyYXRvci5ub2RlLT5kYXRhOworCisgICAgICAgICAgICBpZiAoZGVzY3JpcHRvci0+cG9ydElEID09IHBvcnRJRCAmJiAoZGVzY3JpcHRvci0+dHlwZSAmIHJlY29yZEZpbHRlcikgIT0gMCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByZWNvcmRDb3VudCsrOworCisgICAgICAgICAgICAgICAgLyogZGlzcGxheSBlbnRyeSAqLworICAgICAgICAgICAgICAgIGl4RXRoREJSZWNvcmRTaG93KGRlc2NyaXB0b3IsIHJlY29yZEZpbHRlcik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qIG1vdmUgdG8gdGhlIG5leHQgcmVjb3JkICovCisgICAgICAgICAgICBCVVNZX1JFVFJZX1dJVEhfUkVTVUxUKGl4RXRoREJJbmNyZW1lbnRIYXNoSXRlcmF0b3IoJmRiSGFzaHRhYmxlLCAmaXRlcmF0b3IpLCBsb2NhbF9yZXN1bHQpOworCisgICAgICAgICAgICAvKiBkZWJ1ZyAqLworICAgICAgICAgICAgaWYgKGxvY2FsX3Jlc3VsdCA9PSBJWF9FVEhfREJfQlVTWSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwcmludGYoIkV0aERCIChBUEkpOiBFcnJvciwgZGF0YWJhc2UgYnJvd3NlciBmYWlsZWQgKG5vIGFjY2VzcyksIGdpdmluZyB1cFxuIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIHByaW50ZigiXG5Gb3VuZCAlZCByZWNvcmRzXG5cbiIsIHJlY29yZENvdW50KTsKKyAgICB9Cit9CisKKy8qKgorICogQGJyaWVmIGRpc3BsYXlzIGEgcmVjb3JkIGhlYWRlcgorICoKKyAqIEBwYXJhbSByZWNvcmRGaWx0ZXIgcmVjb3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zcyBcbiIpOworICAgIHByaW50ZigiX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX1xuIik7CisgIH0KKyAgZWxzZSBpZiAocmVjb3JkRmlsdGVyID09IElYX0VUSF9EQl9GSUxURVJJTkdfUkVDT1JEKQorICB7CisgICAgLyogZGlzcGxheSBmaWx0ZXJpbmcgcmVjb3JkIGhlYWRlciAqLworICAgIHByaW50ZigiICAgIE1BQyBhZGRyZXNzICAgIHwgICBBZ2UgIHwgICBUeXBlICAgXG4iKTsKKyAgICBwcmludGYoIl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX1xuIik7CisgIH0KKyAgZWxzZSBpZiAocmVjb3JkRmlsdGVyID09IElYX0VUSF9EQl9XSUZJX1JFQ09SRCkKKyAgeworICAgIC8qIGRpc3BsYXkgV2lGaSByZWNvcmQgaGVhZGVyICovCisgICAgcHJpbnRmKCIgICAgTUFDIGFkZHJlc3MgICAgfCAgIEdXIE1BQyBhZGRyZXNzICBcbiIpOworICAgIHByaW50ZigiX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXG4iKTsKKyAgfQorICBlbHNlIGlmIChyZWNvcmRGaWx0ZXIgPT0gSVhfRVRIX0RCX0ZJUkVXQUxMX1JFQ09SRCkKKyAgeworICAgIC8qIGRpc3BsYXkgRmlyZXdhbGwgcmVjb3JkIGhlYWRlciAqLworICAgIHByaW50ZigiICAgIE1BQyBhZGRyZXNzICAgXG4iKTsKKyAgICBwcmludGYoIl9fX19fX19fX19fX19fX19fX1xuIik7CisgIH0KKyAgZWxzZSBpZiAocmVjb3JkRmlsdGVyID09IElYX0VUSF9EQl9BTExfUkVDT1JEX1RZUEVTKQorICB7CisgICAgLyogZGlzcGxheSBjb21wb3NpdGUgcmVjb3JkIGhlYWRlciAqLworICAgIHByaW50ZigiICAgIE1BQyBhZGRyZXNzICAgfCBSZWNvcmQgfCBBZ2V8ICB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RlICpub2RlOworICAgICAgICBVSU5UMzIgb2Zmc2V0OworICAgICAgIAorICAgICAgICBOT0RFX1NUQUNLX1BPUChzdGFjaywgbm9kZSwgb2Zmc2V0KTsKKworICAgICAgICAvKiB3ZSBjYW4gc3RvcmUgbWF4aW11bSAzMSAoMzIgdG90YWwsIDEgZW1wdHkgcm9vdCkgZW50cmllcyBpbiB0aGUgZ2F0ZXdheSB0cmVlICovCisgICAgICAgIGlmIChvZmZzZXQgPiAoTUFYX0dXX1NJWkUgLSAxKSkgYnJlYWs7CisgICAgICAgIAorICAgICAgICAvKiBjaGVjayBpZiB0aGlzIHJlY29yZCBoYXMgYSBnYXRld2F5IGFkZHJlc3MgKi8KKyAgICAgICAgaWYgKG5vZGUtPmRlc2NyaXB0b3IgIT0gTlVMTCAmJiBub2RlLT5kZXNjcmlwdG9yLT5yZWNvcmREYXRhLndpZmlEYXRhLnR5cGUgPT0gSVhfRVRIX0RCX1dJRklfQVBfVE9fQVApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIGZvdW5kIGEgcmVjb3JkLCBjcmVhdGUgYW4gaW5zZXJ0aW9uIHBsYWNlICovCisgICAgICAgICAgICBpZiAoaW5zZXJ0aW9uUGxhY2UgIT0gTlVMTCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpbnNlcnRpb25QbGFjZS0+cmlnaHQgPSBpeEV0aERCQWxsb2NNYWNUcmVlTm9kZSgpOworICAgICAgICAgICAgICAgIGluc2VydGlvblBsYWNlICAgICAgICA9IGluc2VydGlvblBsYWNlLT5yaWdodDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBnYXRld2F5cyAgICAgICA9IGl4RXRoREJBbGxvY01hY1RyZWVOb2RlKCk7CisgICAgICAgICAgICAgICAgaW5zZXJ0aW9uUGxhY2UgPSBnYXRld2F5czsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGluc2VydGlvblBsYWNlID09IE5VTEwpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogbm8gbm9kZXMgbGVmdCwgYmFpbCBvdXQgd2l0aCB3aGF0IHdlIGhhdmUgKi8KKyAgICAgICAgICAgICAgICBpeE9zYWxDYWNoZURtYUZyZWUoc3RhY2spOworICAgICAgICAgICAgICAgIHJldHVybiBnYXRld2F5czsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgLyogY2xvbmUgdGhlIG9yaWdpbmFsIHJlY29yZCBmb3IgdGhlIGdhdGV3YXkgdHJlZSAqLworICAgICAgICAgICAgaW5zZXJ0aW9uUGxhY2UtPmRlc2NyaXB0b3IgPSBpeEV0aERCQ2xvbmVNYWNEZXNjcmlwdG9yKG5vZGUtPmRlc2NyaXB0b3IpOworICAgICAgICAgICAgCisgICAgICAgICAgICAvKiBpbnNlcnQgYW5kIHVwZGF0ZSB0aGUgb2Zmc2V0IGluIHRoZSBvcmlnaW5hbCByZWNvcmQgKi8KKyAgICAgICAgICAgIG5vZGUtPmRlc2NyaXB0b3ItPnJlY29yZERhdGEud2lmaURhdGEuZ3dBZGRyZXNzSW5kZXggPSBnd0luZGV4Kys7CisgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgIC8qIGJyb3dzZSB0aGUgdHJlZSAqLworICAgICAgICBpZiAobm9kZS0+bGVmdCAhPSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICBOT0RFX1NUQUNLX1BVU0goc3RhY2ssIG5vZGUtPmxlZnQsIExFRlRfQ0hJTERfT0ZGU0VUKG9mZnNldCkpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKG5vZGUtPnJpZ2h0ICE9IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIE5PREVfU1RBQ0tfUFVTSChzdGFjaywgbm9kZS0+cmlnaHQsIFJJR0hUX0NISUxEX09GRlNFVChvZmZzZXQpKTsKKyAgICAgICAgfQorICAgIH0KKyA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3JpdGUoKHZvaWQgKikgKCgoVUlOVDMyKSBwb3J0SW5mby0+dXBkYXRlTWV0aG9kLm5wZUd3VXBkYXRlWm9uZSkgCisgICAgICAgICAgICArIGdhdGV3YXktPmRlc2NyaXB0b3ItPnJlY29yZERhdGEud2lmaURhdGEuZ3dBZGRyZXNzSW5kZXggKiBFTFRfRU5UUllfU0laRSksIAorICAgICAgICAgICAgZ2F0ZXdheSk7CisKKyAgICAgICAgZ2F0ZXdheSA9IGdhdGV3YXktPnJpZ2h0OworICAgIH0KKworICAgIC8qIGZyZWUgdGhlIGdhdGV3YXkgdHJlZSAqLworICAgIGlmIChnYXRld2F5cyAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgaXhFdGhEQkZyZWVNYWNUcmVlTm9kZShnYXRld2F5cyk7CisgICAgfQorCisgICAgRklMTF9TRVRBUE1BQ1RBQkxFX01TRyhtZXNzYWdlLCAKKyAgICAgICAgSVhfT1NBTF9NTVVfVklSVF9UT19QSFlTKHBvcnRJbmZvLT51cGRhdGVNZXRob2QubnBlR3dVcGRhdGVab25lKSk7CisKKyAgICBJWF9FVEhEQl9TRU5EX05QRV9NU0coSVhfRVRIX0RCX1BPUlRfSURfVE9fTlBFKHBvcnRJRCksIG1lc3NhZ2UsIHJlc3VsdCk7CisKKyAgICBpZiAocmVzdWx0ID09IElYX1NVQ0NFU1MpCisgICAgeworICAgICAgICAvKiB1cGRhdGUgdGhlIG1haW4gdHJlZSAodGhlIHN0YXRpb25zIHRyZWUpICovCisgICAgICAgIHBvcnRJbmZvLT51cGRhdGVNZXRob2Quc2VhcmNoVHJlZSA9IHN0YXRpb25zOworICAgICAgICAKKyAgICAgICAgcmVzdWx0ID0gaXhFdGhEQk5QRVVwZGF0ZUhhbmRsZXIocG9ydElELCBJWF9FVEhfREJfV0lGSV9SRUNPUkQpOworICAgIH0KKworICAgIGl4RXRoREJVcGRhdGVVbmxvY2soKTsKKworICAgIHJldHVybiByZXN1bHQ7Cit9CmRpZmYgLS1naX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Ki8KKwkJICAgIHBoeVByZXNlbnRbaV0gPSBUUlVFOworCQl9IC8qIGVuZCBvZiBpZihpeEV0aE1paVBoeUlkKSAqLworCQllbHNlCisJCXsKKwkJICAgIGlmIChpeEV0aE1paVBoeUlkW2ldICE9IElYX0VUSF9NSUlfSU5WQUxJRF9QSFlfSUQpCisJCSAgICB7CisJCQkvKiB1bnN1cHBvcnRlZCBwaHkgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIGl4T3NhbExvZyAoSVhfT1NBTF9MT0dfTFZMX0VSUk9SLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RET1VULAorCQkJCSAgICAiaXhFdGhNaWlQaHlTY2FuIDogdW5leHBlY3RlZCBNaWkgUEhZIElEICU4Ljh4XG4iLCAKKwkJCQkgICAgaXhFdGhNaWlQaHlJZFtpXSwgMiwgMywgNCwgNSwgNik7CisJCQlpeEV0aE1paVBoeUlkW2ldID0gSVhfRVRIX01JSV9VTktOT1dOX1BIWV9JRDsKKwkJCXBoeVByZXNlbnRbaV0gPSBUUlVFOworCQkgICAgfQorCQl9IAorCSAgICB9CisJfQorICAgIH0KKyAgICByZXR1cm4gSVhfU1VDQ0VTUzsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICoKKyAqIENvbmZpZ3VyZSB0aGUgUEhZIGF0IHRoZSBzcGVjaWZpZWQgYWRkcmVzcworICoKKyAqLworUFVCTElDIElYX1NUQVRVUworaXhFdGhNaWlQaHlDb25maWcoVUlOVDMyIHBoeUFkZHIsCisJCSAgQk9PTCBzcGVlZDEwMCwKKwkJICBCT09MIGZ1bGxEdXBsZXgsCisJCSAgQk9PTCBhdXRvbmVnb3RpYXRlKQoreworICAgIFVJTlQxNiByZWd2YWw9MDsKKworICAgIC8qIHBhcmFtZXRlciBjaGVjayAqLworICAgIGlmICgocGh5QWRkciA8IElYUDQyN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EV0aEFjY01paVJlYWRSdG4ocGh5QWRkciwgIElYX0VUSF9NSUlfQ1RSTF9SRUcsICZjcmVndmFsKTsKKworICAgIC8qIGdldCBsaW5rIGluZm9ybWF0aW9uICovCisgICAgaWYgKGl4RXRoTWlpTGlua1N0YXR1cyhwaHlBZGRyLAorCQkJICAgJmxpbmtVcCwKKwkJCSAgICZzcGVlZDEwMCwKKwkJCSAgICZmdWxsRHVwbGV4LAorCQkJICAgJmF1dG9uZWcpICE9IElYX0VUSF9BQ0NfU1VDQ0VTUykKKyAgICB7CisJcHJpbnRmKCJQSFkgU3RhdHVzIHVua25vd25cbiIpOworCXJldHVybiBJWF9GQUlMOworICAgIH0KKworICAgIHByaW50ZigiUEhZIElEIFtwaHlBZGRyXTogJTguOHhcbiIsaXhFdGhNaWlQaHlJZFtwaHlBZGRyXSk7CisgICAgcHJpbnRmKCAiIFN0YXR1cyByZWc6ICAlNC40eFxuIixzcmVndmFsKTsKKyAgICBwcmludGYoICIgY29udHJvbCByZWc6ICU0LjR4XG4iLGNyZWd2YWwpOworICAgIC8qIGRpc3BsYXkgbGluayBpbmZvcm1hdGlvbiAqLworICAgIHByaW50ZigiUEhZIFN0YXR1czpcbiIpOworICAgIHByaW50ZigiICAgIExpbmsgaXMgJXNcbiIsCisJICAgKGxpbmtVcCA/ICJVcCIgOiAiRG93biIpKTsKKyAgICBpZigoc3JlZ3ZhbCAmIElYX0VUSF9NSUlfU1JfUkVNT1RFX0ZBVUxUKSAhPSAwKQorICAgIHsKKwlwcmludGYoIiAgICBSZW1vdGUgZmF1bHQgZGV0ZWN0ZWRcbiIpOworICAgIH0KKyAgICBwcmludGYoIiAgICBBdXRvIE5lZ290aWF0aW9uICVzXG4iLAorCSAgIChhdXRvbmVnID8gIkNvbXBsZXRlZCIgOiAiTm90IENvbXBsZXRlZCIpKTsKKworICAgIHByaW50ZigiUEhZIENvbmZpZ3VyYXRpb246XG4iKTsKKyAgICBwcmludGYoIiAgICBTcGVlZCAlc01iL3N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PSBOVUxMKQorICAgIHsKKyAgICAgICAgc3RhdHVzID0gSVhfTlBFRExfUEFSQU1fRVJSOworICAgICAgICBJWF9OUEVETF9FUlJPUl9SRVBPUlQgKCJpeE5wZURsTWljcm9jb2RlSW1hZ2VMaWJyYXJ5T3ZlcnJpZGUgLSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImludmFsaWQgcGFyYW1ldGVyXG4iKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgc3RhdHVzID0gaXhOcGVEbEltYWdlTWdyTWljcm9jb2RlSW1hZ2VMaWJyYXJ5T3ZlcnJpZGUgKGNsaWVudEltYWdlTGlicmFyeSk7CisgICAgICAgIGlmIChzdGF0dXMgIT0gSVhfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgc3RhdHVzID0gSVhfRkFJTDsKKyAgICAgICAgfQorICAgIH0gLyogZW5kIG9mIGlmLWVsc2UoY2xpZW50SW1hZ2VMaWJyYXJ5KSAqLworCisgICAgSVhfTlBFRExfVFJBQ0UxIChJWF9OUEVETF9GTl9FTlRSWV9FWElULAorICAgICAgICAgICAgICAgICAgICAgIkV4aXRpbmcgaXhOcGVEbE1pY3JvY29kZUltYWdlTGlicmFyeU92ZXJyaWRlIDogIgorICAgICAgICAgICAgICAgICAgICAgInN0YXR1cyA9ICVkXG4iLCBzdGF0dXMpOworICAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeE5wZURsSW1hZ2VEb3dubG9hZAorICovCitQVUJMSUMgSVhfU1RBVFVTCitpeE5wZURsSW1hZ2VEb3dubG9hZCAoSXhOcGVEbEltYWdlSWQgKmltYWdlSWRQdHIsCisgICAgICAgICAgICAgICAgICAgICAgQk9PTCB2ZXJpZnkpCit7CisgICAgVUlOVDMyICAgICAgICBpbWFnZVNpemU7CisgICAgVUlOVDMyICAgICAgICppbWFnZUNvZGVQdHIgID0gTlVMTDsKKyA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gICBpZiAobnBlSWQgPT0gSVhfTlBFRExfTlBFSURfTlBFQSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoaXhGZWF0dXJlQ3RybENvbXBvbmVudENoZWNrKElYX0ZFQVRVUkVDVFJMX05QRUEpID09CisgICAgICAgICAgICAgICAgICAgIElYX0ZFQVRVUkVfQ1RSTF9DT01QT05FTlRfRElTQUJMRUQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBJWF9OUEVETF9XQVJOSU5HX1JFUE9SVCgiV2FybmluZzogdGhlIE5QRSBBIGNvbXBvbmVudCB5b3Ugc3BlY2lmaWVkIGRvZXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgbm90IGV4aXN0XG4iKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIElYX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSAvKiBlbmQgb2YgaWYobnBlSWQpICovCisgICAgICAgICAgICBlbHNlIGlmIChucGVJZCA9PSBJWF9OUEVETF9OUEVJRF9OUEVCKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChpeEZlYXR1cmVDdHJsQ29tcG9uZW50Q2hlY2soSVhfRkVBVFVSRUNUUkxfTlBFQik9PQorICAgICAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0RJU0FCTEVEKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgSVhfTlBFRExfV0FSTklOR19SRVBPUlQoIldhcm5pbmc6IHRoZSBOUEUgQiBjb21wb25lbnQgeW91IHNwZWNpZmllZCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBkb2VzIG5vdCBleGlzdFxuIik7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBJWF9TVUNDRVNTOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gLyogZW5kIG9mIGVsc2VpZihucGVJZCkgKi8KKyAgICAgICAgICAgIGVsc2UgaWYgKG5wZUlkID09IElYX05QRURMX05QRUlEX05QRUMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9OUEVDKT09CisgICAgICAgICAgICAgICAgICAgIElYX0ZFQVRVUkVfQ1RSTF9DT01QT05FTlRfRElTQUJMRUQpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBJWF9OUEVETF9XQVJOSU5HX1JFUE9SVCgiV2FybmluZzogdGhlIE5QRSBDIGNvbXBvbmVudCB5b3Ugc3BlY2lmaWVkIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGRvZXMgbm90IGV4aXN0XG4iKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIElYX1NVQ0NFU1M7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSAvKiBlbmQgb2YgZWxzZWlmKG5wZUlkKSAqLworICAgICAgICB9IC8qIGVuZCBvZiBpZihJWF9GRUFUVVJFX0NUUkxfU0lMSUNPTl9UWVBFX0IwKSAqLyAvKkVuZCBvZiBTaWxpY29uIFR5cGUgQ2hlY2sqLworCisgICAgICAgIC8qIHN0b3AgYW5kIHJlc2V0IHRoZSBOUEUgKi8KKyAgICAgICAgaWYgKElYX1NVQ0NFU1MgIT0gaXhOcGVEbE5wZVN0b3BBbmRSZXNldCAobnBlSWQpKQorICAgICAgICB7CisgICAgICAgICAgICBJWF9OUEVETF9FUlJPUl9SRVBPUlQgKCJGYWlsZWQgdG8gc3RvcCBhbmQgcmVzZXQgTlBFXG4iKTsKKyAgICAgICAgICAgIHJldHVybiBJWF9GQUlMOworICAgICAgICB9CisKKyAgICAgICAgLyogTG9jYXRlIGltYWdlICovCisgICAgICAgIHN0YXR1cyA9IGl4TnBlRGxJbWFnZU1nckltYWdlTG9jYXRlIChpbWFnZUlkUHRyLCAmaW1hZ2VDb2RlUHRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmltYWdlU2l6ZSk7CisgICAgICAgIGlmIChJWF9TVUNDRVNTID09IHN0YXR1cykKKyAgICAgICAgeworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAqIElmIGRvd25sb2FkIHdhcyBzdWNjZXNzZnVsLCBzdG9yZSBpbWFnZSBJZCBpbiBsaXN0IG9mCisgICAgICAgICAgICAgKiBjdXJyZW50bHkgbG9hZGVkIGltYWdlcy4gSWYgYSBjcml0aWNhbCBlcnJvciBvY2N1cmVkCisgICAgICAgICAgICAgKiBkdXJpbmcgZG93bmxvYWQsIHJlY29yZCB0aGF0IHRoZSBOUEUgaGFzIGFuIGludmFsaWQgaW1hZ2UKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgc3RhdHVzID0gaXhOcGVEbE5wZU1nckltYWdlTG9hZCAobnBlSWQsIGltYWdlQ29kZVB0ciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZlcmlmeSk7CisgICAgICAgICAgICBpZiAoSVhfU1VDQ0VTUyA9PSBzdGF0dXMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaXhOcGVEbE5wZVN0YXRlW25wZUlkXS5pbWFnZUlkID0gKmltYWdlSWRQdHI7CisgICAgICAgICAgICAgICAgaXhOcGVEbE5wZVN0YXRlW25wZUlkXS52YWxpZEltYWdlID0gVFJVRTsKKyAgICAgICAgICAgICAgICBpeE5wZURsU3RhdHMuc3VjY2Vzc2Z1bERvd25sb2FkcysrOworCisgICAgICAgICAgICAgICAgc3RhdHVzID0gIGl4TnBlRGxOcGVFeGVjdXRpb25TdGFydCAobnBlSWQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoKHN0YXR1cyA9PSBJWF9OUEVETF9DUklUSUNBTF9OUEVfRVJSKSB8fAorICAgICAgICAgICAgICAgICAgICAgKHN0YXR1cyA9PSBJWF9OUEVETF9DUklUSUNBTF9NSUNST0NPREVfRVJSKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpeE5wZURsTnBlU3RhdGVbbnBlSWRdLmltYWdlSWQgPSAqaW1hZ2VJZFB0cjsKKyAgICAgICAgICAgICAgICBpeE5wZURsTnBlU3RhdGVbbnBlSWRdLnZhbGlkSW1hZ2UgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICBpeE5wZURsU3RhdHMuY3JpdGljYWxGYWlsRG93bmxvYWRzKys7CisgICAgICAgICAgICB9CisgICAgICAgIH0gLyogZW5kIG9mIGlmKElYX1NVQ0NFU1MpICovIC8qIGNvbmRpdGlvbjogaW1hZ2UgbG9jYXRlZCBzdWNjZXNzZnVsbHkgaW4gbWljcm9jb2RlIGltYWdlICovCisgICAgfSAvKiBlbmQgb2YgaWYtZWxzZShucGVJZCkgKi8gLyogY29uZGl0aW9uOiBwYXJhbWV0ZXIgY2hlY2tzIG9rICovCisKKyAgICBJWF9OUEVETF9UUkFDRTEgKElYX05QRURMX0ZOX0VOVFJZX0VYSVQsCisgICAgICAgICAgICAgICAgICAgICAiRXhpdGluZyBpeE5wZURsSW1hZ2VEb3dubG9hZCA6IHN0YXR1cyA9ICVkXG4iLCBzdGF0dXMpOworICAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeE5wZURsQXZhaWxhYmxlSW1hZ2VzQ291bnRHZXQKKyAqLworUFVCTElDIElYX1NUQVRVUworaXhOcGVEbEF2YWlsYWJsZUltYWdlc0NvdW50R2V0IChVSU5UMzIgKm51bUltYWdlc1B0cikKK3sKKyAgICBJWF9TVEFUVVMgc3RhdHVzOworCisgICAgSVhfTlBFRExfVFJBQ0UwIChJWF9OUEVETF9GTl9FTlRSWV9FWElULAorICAgICAgICAgICAgICAgICAgICAgIkVudGVyaW5nIGl4TnBlRGxBdmFpbGFibGVJbWFnZXNDb3VudEdldFxuIik7CisKKyAgICAvKiBDaGVjayBpbnB1dCBwYXJhbWV0ZXJzICovCisgICAgaWYgKG51bUltYWdlc1B0ciA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgc3RhdHVzID0gSVhfTlBFRExfUEFSQU1fRVJSOworICAgICAgICBJWF9OUEVETF9FUlJPUl9SRVBPUlQgKCJpeE5wZURsQXZhaWxhYmxlSW1hZ2VzQ291bnRHZXQgLSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImludmFsaWQgcGFyYW1ldGVyXG4iKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLyoKKyAgICAgICAgICogVXNlIEltYWdlTWdyIG1vZHVsZSB0byBnZXQgbm8uIG9mIGltYWdlcyBsaXN0ZWQgaW4gSW1hZ2UgTGlicmFyeSBIZWFkZXIuCisgICAgICAgICAqIElmIE5VTEwgaXMgcGFzc2VkIGFzIGltYWdlTGlzdFB0ciBwYXJhbWV0ZXIgdG8gZm9sbG93aW5nIGZ1bmN0aW9uLAorICAgICAgICAgKiBpdCB3aWxsIG9ubHkgZmlsbCBudW1iZXIgb2YgaW1hZ2VzIGludG8gbnVtSW1hZ2VzUHRyCisgICAgICAgICAqLworICAgICAgICBzdGF0dXMgPSBpeE5wZURsSW1hZ2VNZ3JJbWFnZUxpc3RFeHRyYWN0IChOVUxMLCBudW1JbWFnZXNQdHIpOworICAgIH0gLyogZW5kIG9mIGlmLWVsc2UobnVtSW1hZ2VzUHRyKSAqLworCisgICAgSVhfTlBFRExfVFJBQ0UxIChJWF9OUEVETF9GTl9FTlRSWV9FWElULAorICAgICAgICAgICAgICAgICAgICAgIkV4aXRpbmcgaXhOcGVEbEF2YWlsYWJsZUltYWdlc0NvdW50R2V0IDogIgorICAgICAgICAgICAgICAgICAgICAgInN0YXR1cyA9ICVkXG4iLCBzdGF0dXMpOworICAgIHJldHVybiBzdGF0dXM7Cit9CisKKy8qCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeE5wZURsQXZhaWxhYmxlSW1hZ2VzTGlzdEdldAorICovCitQVUJMSUMgSVhfU1RBVFVTCitpeE5wZURsQXZhaWxhYmxlSW1hZ2VzTGlzdEdldCAoSXhOcGVEbEltYWdlSWQgKmltYWdlSWRMaXN0UHRyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVJTlQzMiAqbGlzdFNpemVQdHIpCit7CisgICAgSVhfU1RBVFVTIHN0YXR1czsKKworICAgIElYX05QRURMX1RSQUNFMCAoSVhfTlBFRExfRk5fRU5UUllfRVhJVCwKKyAgICAgICAgICAgICAgICAgICAgICJFbnRlcmluZyBpeE5wZURsQXZhaWxhYmxlSW1hZ2VzTGlzdEdldFxuIik7CisKKyAgICAvKiBDaGVjayBpbnB1dCBwYXJhbWV0ZXJzICovCisgICAgaWYgKChpbWFnZUlkTGlzdFB0ciA9PSBOVUxMKSB8fCAobGlzdFNpemVQdHIgPT0gTlVMTCkpCisgICAgeworICAgICAgICBzdGF0dXMgPSBJWF9OUEVETF9QQVJBTV9FUlI7CisgICAgICAgIElYX05QRURMX0VSUk9SX1JFUE9SVCAoIml4TnBlRGxBdmFpbGFibGVJbWFnZXNMaXN0R2V0IC0gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpbnZhbGlkIHBhcmFtZXRlclxuIik7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8qIENhbGwgSW1hZ2VNZ3IgdG8gZ2V0IGxpc3Qgb2YgaW1hZ2VzIGxpc3RlZCBpbiBJbWFnZSBMaWJyYXJ5IEhlYWRlciAqLworICAgICAgICBzdGF0dXMgPSBpeE5wZURsSW1hZ2VNZ3JJbWFnZUxpc3RFeHRyYWN0IChpbWFnZUlkTGlzdFB0ciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFNpemVQdHIpOworICAgIH0gLyogZW5kIG9mIGlmLWVsc2UoaW1hZ2VJZExpc3RQdHIpICovCisKKyAgICBJWF9OUEVETF9UUkFDRTEgKElYX05QRURMX0ZOX0VOVFJZX0VYSVQsCisgICAgICAgICAgICAgICAgICAgICAiRXhpdGluZyBpeE5wZURsQXZhaWxhYmxlSW1hZ2VzTGlzdEdldCA6IHN0YXR1cyA9ICVkXG4iLAorICAgICAgICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgICByZXR1cm4gc3RhdHVzOworfQorCisvKgorICogRnVuY3Rpb24gZGVmaW5pdGlvbjogaXhOcGVEbExvYWRlZEltYWdlR2V0CisgKi8KK1BVQkxJQyBJWF9TVEFUVVMKK2l4TnBlRGxMb2FkZWRJbWFnZUdldCAoSXhOcGVEbE5wZUlkIG5wZUlkLAorICAgICAgICAgICAgICAgICAgICAgICBJeE5wZURsSW1hZ2VJZCAqaW1hZ2VJZFB0cikKK3sKKyAgICBJWF9TVEFUVVMgc3RhdHVzID0gSVhfU1VDQ0VTUzsKKworICAgIElYX05QRURMX1RSQUNFMCAoSVhfTlBFRExfRk5fRU5UUllfRVhJVCwKKyAgICAgICAgICAgICAgICAgICAgICJFbnRlcmluZyBpeE5wZURsTG9hZGVkSW1hZ2VHZXRcbiIpOworCisgICAgLyogQ2hlY2sgaW5wdXQgcGFyYW1ldGVycyAqLworICAgIGlmICgobnBlSWQgPj0gSVhfTlBFRExfTlBFSURfTUFYKSB8fCAobnBlSWQgPCAwKSB8fCAoaW1hZ2VJZFB0ciA9PSBOVUxMKSkKKyAgICB7CisgICAgICAgIHN0YXR1cyA9IElYX05QRURMX1BBUkFNX0VSUjsKKyAgICAgICAgSVhfTlBFRExfRVJST1JfUkVQT1JUICgiaXhOcGVEbExvYWRlZEltYWdlR2V0IC0gaW52YWxpZCBwYXJhbWV0ZXJcbiIpOworICAgIH0KKyAgICBlbHNlCisgICAgeworCisgICAgICAgICAvKiBJZiBub3QgSVhQNDJYIEEwIHN0ZXBwaW5nLCBwcm9jZWVkIHRvIGNoZWNrIGZvciBleGlzdGVuY2Ugb2YgbnBlJ3MgKi8KKyAgICAgICAgIGlmICgoSVhfRkVBVFVSRV9DVFJMX1NJTElDT05fVFlQRV9BMCAhPQorCSAgICAgIChpeEZlYXR1cmVDdHJsUHJvZHVjdElkUmVhZCgpICYgSVhfRkVBVFVSRV9DVFJMX1NJTElDT05fU1RFUFBJTkdfTUFTSykpCisJICAgICB8fCAoSVhfRkVBVFVSRV9DVFJMX0RFVklDRV9UWVBFX0lYUDQyWCAhPSBpeEZlYXR1cmVDdHJsRGV2aWNlUmVhZCAoKSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChucGVJZCA9PSBJWF9OUEVETF9OUEVJRF9OUEVBICYmCisgICAgICAgICAgICAgICAgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9OUEVBKSA9PQorICAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0RJU0FCTEVEKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBJWF9OUEVETF9XQVJOSU5HX1JFUE9SVCgiV2FybmluZzogdGhlIE5QRSBBIGNvbXBvbmVudCB5b3Ugc3BlY2lmaWVkIGRvZXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBub3QgZXhpc3RcbiIpOworICAgICAgICAgICAgICAgIHJldHVybiBJWF9TVUNDRVNTOworICAgICAgICAgICAgfSAvKiBlbmQgb2YgaWYobnBlSWQpICovCisKKyAgICAgICAgICAgIGlmIChucGVJZCA9PSBJWF9OUEVETF9OUEVJRF9OUEVCICYmCisgICAgICAgICAgICAgICAgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9OUEVCKSA9PQorICAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0RJU0FCTEVEKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBJWF9OUEVETF9XQVJOSU5HX1JFUE9SVCgiV2FybmluZzogdGhlIE5QRSBCIGNvbXBvbmVudCB5b3Ugc3BlY2lmaWVkIGRvZXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBub3QgZXhpc3RcbiIpOworICAgICAgICAgICAgICAgIHJldHVybiBJWF9TVUNDRVNTOworICAgICAgICAgICAgfSAvKiBlbmQgb2YgaWYobnBlSWQpICovCisKKyAgICAgICAgICAgIGlmIChucGVJZCA9PSBJWF9OUEVETF9OUEVJRF9OUEVDICYmCisgICAgICAgICAgICAgICAgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9OUEVDKSA9PQorICAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0RJU0FCTEVEKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBJWF9OUEVETF9XQVJOSU5HX1JFUE9SVCgiV2FybmluZzogdGhlIE5QRSBDIGNvbXBvbmVudCB5b3Ugc3BlY2lmaWVkIGRvZXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBub3QgZXhpc3RcbiIpOworICAgICAgICAgICAgICAgIHJldHVybiBJWF9TVUNDRVNTOworICAgICAgICAgICAgfSAvKiBlbmQgb2YgaWYobnBlSWQpICovCisgICAgICAgIH0gLyogZW5kIG9mIGlmIG5vdCBJWFA0MngtQTAgc2lsaWNvbiAqLworCisgICAgICAgIGlmIChpeE5wZURsTnBlU3RhdGVbbnBlSWRdLnZhbGlkSW1hZ2UpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIHVzZSBucGVJZCB0byBnZXQgaW1hZ2VJZCBmcm9tIGxpc3Qgb2YgY3VycmVudGx5IGxvYWRlZAorICAgICAgICAgICAgICAgaW1hZ2VzICovCisgICAgICAgICAgICA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HsKKyAgICAgICAgc3RhdHVzID0gSVhfTlBFRExfUEFSQU1fRVJSOworICAgICAgICBJWF9OUEVETF9FUlJPUl9SRVBPUlQgKCJpeE5wZURsTGF0ZXN0SW1hZ2VHZXQgLSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImludmFsaWQgcGFyYW1ldGVyXG4iKTsKKyAgICB9IC8qIGVuZCBvZiBpZihucGVJZCkgKi8KKyAgICBlbHNlCisgICAgeworCisJLyogSWYgbm90IElYUDQyWCBBMCBzdGVwcGluZywgcHJvY2VlZCB0byBjaGVjayBmb3IgZXhpc3RlbmNlIG9mIG5wZSdzICovCisJaWYgKChJWF9GRUFUVVJFX0NUUkxfU0lMSUNPTl9UWVBFX0EwICE9CisJICAgICAoaXhGZWF0dXJlQ3RybFByb2R1Y3RJZFJlYWQoKSAmIElYX0ZFQVRVUkVfQ1RSTF9TSUxJQ09OX1NURVBQSU5HX01BU0spKQorCSAgICB8fCAoSVhfRkVBVFVSRV9DVFJMX0RFVklDRV9UWVBFX0lYUDQyWCAhPSBpeEZlYXR1cmVDdHJsRGV2aWNlUmVhZCAoKSkpCisgICAgICAgIHsKKyAgICAgICAgICAgIGlmIChucGVJZCA9PSBJWF9OUEVETF9OUEVJRF9OUEVBICYmCisgICAgICAgICAgICAgICAgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9OUEVBKSA9PQorICAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0RJU0FCTEVEKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBJWF9OUEVETF9XQVJOSU5HX1JFUE9SVCgiV2FybmluZzogdGhlIE5QRSBBIGNvbXBvbmVudCB5b3Ugc3BlY2lmaWVkIGRvZXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBub3QgZXhpc3RcbiIpOworICAgICAgICAgICAgICAgIHJldHVybiBJWF9TVUNDRVNTOworICAgICAgICAgICAgfSAvKiBlbmQgb2YgaWYobnBlSWQpICovCisKKyAgICAgICAgICAgIGlmIChucGVJZCA9PSBJWF9OUEVETF9OUEVJRF9OUEVCICYmCisgICAgICAgICAgICAgICAgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9OUEVCKSA9PQorICAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0RJU0FCTEVEKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBJWF9OUEVETF9XQVJOSU5HX1JFUE9SVCgiV2FybmluZzogdGhlIE5QRSBCIGNvbXBvbmVudCB5b3Ugc3BlY2lmaWVkIGRvZXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBub3QgZXhpc3RcbiIpOworICAgICAgICAgICAgICAgIHJldHVybiBJWF9TVUNDRVNTOworICAgICAgICAgICAgfSAvKiBlbmQgb2YgaWYobnBlSWQpICovCisKKyAgICAgICAgICAgIGlmIChucGVJZCA9PSBJWF9OUEVETF9OUEVJRF9OUEVDICYmCisgICAgICAgICAgICAgICAgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9OUEVDKSA9PQorICAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0RJU0FCTEVEKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBJWF9OUEVETF9XQVJOSU5HX1JFUE9SVCgiV2FybmluZzogdGhlIE5QRSBDIGNvbXBvbmVudCB5b3Ugc3BlY2lmaWVkIGRvZXMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBub3QgZXhpc3RcbiIpOworICAgICAgICAgICAgICAgIHJldHVybiBJWF9TVUNDRVNTOworICAgICAgICAgICAgfSAvKiBlbmQgb2YgaWYobnBlSWQpICovCisg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KyAgICAgICAgICAgICAgICAgICAgICJFbnRlcmluZyBpeE5wZURsTnBlU3RvcEFuZFJlc2V0XG4iKTsKKworICAgIC8qIEVuc3VyZSBpbml0aWFsaXNhdGlvbiBoYXMgYmVlbiBjb21wbGV0ZWQgKi8KKyAgICBpeE5wZURsTnBlTWdySW5pdCgpOworCisgICAgLyogSWYgbm90IElYUDQyWCBBMCBzdGVwcGluZywgcHJvY2VlZCB0byBjaGVjayBmb3IgZXhpc3RlbmNlIG9mIG5wZSdzICovCisgICAgaWYgKChJWF9GRUFUVVJFX0NUUkxfU0lMSUNPTl9UWVBFX0EwICE9CisJIChpeEZlYXR1cmVDdHJsUHJvZHVjdElkUmVhZCgpICYgSVhfRkVBVFVSRV9DVFJMX1NJTElDT05fU1RFUFBJTkdfTUFTSykpCisJfHwgKElYX0ZFQVRVUkVfQ1RSTF9ERVZJQ0VfVFlQRV9JWFA0MlggIT0gaXhGZWF0dXJlQ3RybERldmljZVJlYWQgKCkpKQorICAgIHsKKyAgICAgICAgLyoKKyAgICAgICAgICogQ2hlY2sgd2hldGhlciBOUEUgaXMgcHJlc2VudAorICAgICAgICAgKi8KKyAgICAgICAgaWYgKElYX05QRURMX05QRUlEX05QRUEgPT0gbnBlSWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIENoZWNrIHdoZXRoZXIgTlBFIEEgaXMgcHJlc2VudCAqLworICAgICAgICAgICAgaWYgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9OUEVBKT09CisgICAgICAgICAgICAgICAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBOUEUgQSBkb2VzIG5vdCBwcmVzZW50ICovCisgICAgICAgICAgICAgICAgSVhfTlBFRExfV0FSTklOR19SRVBPUlQgKCJpeE5wZURsTnBlU3RvcEFuZFJlc2V0IC0gV2FybmluZzpOUEVBIGRvZXMgbm90IHByZXNlbnQuXG4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSAvKiBlbmQgb2YgaWYoSVhfTlBFRExfTlBFSURfTlBFQSkgKi8KKyAgICAgICAgZWxzZSBpZiAoSVhfTlBFRExfTlBFSURfTlBFQiA9PSBucGVJZCkKKyAgICAgICAgeworICAgICAgICAgICAgLyogQ2hlY2sgd2hldGhlciBOUEUgQiBpcyBwcmVzZW50ICovCisgICAgICAgICAgICBpZiAoaXhGZWF0dXJlQ3RybENvbXBvbmVudENoZWNrKElYX0ZFQVRVUkVDVFJMX05QRUIpPT0KKyAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0RJU0FCTEVEKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIE5QRSBCIGRvZXMgbm90IHByZXNlbnQgKi8KKyAgICAgICAgICAgICAgICBJWF9OUEVETF9XQVJOSU5HX1JFUE9SVCAoIml4TnBlRGxOcGVTdG9wQW5kUmVzZXQgLSBXYXJuaW5nOk5QRUIgZG9lcyBub3QgcHJlc2VudC5cbiIpOworICAgICAgICAgICAgICAgIHJldHVybiBJWF9TVUNDRVNTOworICAgICAgICAgICAgfQorICAgICAgICB9IC8qIGVuZCBvZiBlbHNlaWYoSVhfTlBFRExfTlBFSURfTlBFQikgKi8KKyAgICAgICAgZWxzZSBpZiAoSVhfTlBFRExfTlBFSURfTlBFQyA9PSBucGVJZCkKKyAgICAgICAgeworICAgICAgICAgICAgLyogQ2hlY2sgd2hldGhlciBOUEUgQyBpcyBwcmVzZW50ICovCisgICAgICAgICAgICBpZiAoaXhGZWF0dXJlQ3RybENvbXBvbmVudENoZWNrKElYX0ZFQVRVUkVDVFJMX05QRUMpPT0KKyAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0RJU0FCTEVEKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIE5QRSBDIGRvZXMgbm90IHByZXNlbnQgKi8KKyAgICAgICAgICAgICAgICBJWF9OUEVETF9XQVJOSU5HX1JFUE9SVCAoIml4TnBlRGxOcGVTdG9wQW5kUmVzZXQgLSBXYXJuaW5nOk5QRUMgZG9lcyBub3QgcHJlc2VudC5cbiIpOworICAgICAgICAgICAgICAgIHJldHVybiBJWF9TVUNDRVNTOworICAgICAgICAgICAgfQorICAgICAgICB9IC8qIGVuZCBvZiBlbHNlaWYoSVhfTlBFRExfTlBFSURfTlBFQykgKi8KKyAgICAgICAgZWxzZQorICAgICAgICB7CisgICAgICAgICAgICAvKiBJbnZhbGlkIE5QRSBJRCAqLworICAgICAgICAgICAgSVhfTlBFRExfRVJST1JfUkVQT1JUICgiaXhOcGVEbE5wZVN0b3BBbmRSZXNldCAtIGludmFsaWQgTnBlIElEXG4iKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IElYX05QRURMX1BBUkFNX0VSUjsKKyAgICAgICAgfSAvKiBlbmQgb2YgaWYtZWxzZShJWF9OUEVETF9OUEVJRF9OUEVDKSAqLworICAgIH0gLyogZW5kIG9mIGlmIG5vdCBJWFA0MngtQTAgU2lsaWNvbiAqLworCisgICAgaWYgKHN0YXR1cyA9PSBJWF9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgLyogY2FsbCBOcGVNZ3IgZnVuY3Rpb24gdG8gc3RvcCB0aGUgTlBFICovCisgICAgICAgIHN0YXR1cyA9IGl4TnBlRGxOcGVNZ3JOcGVTdG9wIChucGVJZCk7CisgICAgICAgIGlmIChzdGF0dXMgPT0gSVhfU1VDQ0VTUykKKyAgICAgICAgeworICAgICAgICAgICAgLyogY2FsbCBOcGVNZ3IgZnVuY3Rpb24gdG8gcmVzZXQgdGhlIE5QRSAqLworICAgICAgICAgICAgc3RhdHVzID0gaXhOcGVEbE5wZU1nck5wZVJlc2V0IChucGVJZCk7CisgICAgICAgIH0KKyAgICB9IC8qIG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3RybERldmljZVJlYWQgKCkpKQorICAgIHsKKyAgICAgICAgLyoKKyAgICAgICAgICogQ2hlY2sgd2hldGhlciBOUEUgaXMgcHJlc2VudAorICAgICAgICAgKi8KKyAgICAgICAgaWYgKElYX05QRURMX05QRUlEX05QRUEgPT0gbnBlSWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIENoZWNrIHdoZXRoZXIgTlBFIEEgaXMgcHJlc2VudCAqLworICAgICAgICAgICAgaWYgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9OUEVBKT09CisgICAgICAgICAgICAgICAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBOUEUgQSBkb2VzIG5vdCBwcmVzZW50ICovCisgICAgICAgICAgICAgICAgSVhfTlBFRExfV0FSTklOR19SRVBPUlQgKCJpeE5wZURsTnBlRXhlY3V0aW9uU3RhcnQgLSBXYXJuaW5nOk5QRUEgZG9lcyBub3QgcHJlc2VudC5cbiIpOworICAgICAgICAgICAgICAgIHJldHVybiBJWF9TVUNDRVNTOworICAgICAgICAgICAgfQorICAgICAgICB9IC8qIGVuZCBvZiBpZihJWF9OUEVETF9OUEVJRF9OUEVBKSAqLworICAgICAgICBlbHNlIGlmIChJWF9OUEVETF9OUEVJRF9OUEVCID09IG5wZUlkKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBDaGVjayB3aGV0aGVyIE5QRSBCIGlzIHByZXNlbnQgKi8KKyAgICAgICAgICAgIGlmIChpeEZlYXR1cmVDdHJsQ29tcG9uZW50Q2hlY2soSVhfRkVBVFVSRUNUUkxfTlBFQik9PQorICAgICAgICAgICAgICAgIElYX0ZFQVRVUkVfQ1RSTF9DT01QT05FTlRfRElTQUJMRUQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogTlBFIEIgZG9lcyBub3QgcHJlc2VudCAqLworICAgICAgICAgICAgICAgIElYX05QRURMX1dBUk5JTkdfUkVQT1JUICgiaXhOcGVEbE5wZUV4ZWN1dGlvblN0YXJ0IC0gV2FybmluZzpOUEVCIGRvZXMgbm90IHByZXNlbnQuXG4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSAvKiBlbmQgb2YgZWxzZWlmKElYX05QRURMX05QRUlEX05QRUIpICovCisgICAgICAgIGVsc2UgaWYgKElYX05QRURMX05QRUlEX05QRUMgPT0gIG5wZUlkKQorICAgICAgICB7CisgICAgICAgICAgICAvKiBDaGVjayB3aGV0aGVyIE5QRSBDIGlzIHByZXNlbnQgKi8KKyAgICAgICAgICAgIGlmIChpeEZlYXR1cmVDdHJsQ29tcG9uZW50Q2hlY2soSVhfRkVBVFVSRUNUUkxfTlBFQyk9PQorICAgICAgICAgICAgICAgIElYX0ZFQVRVUkVfQ1RSTF9DT01QT05FTlRfRElTQUJMRUQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogTlBFIEMgZG9lcyBub3QgcHJlc2VudCAqLworICAgICAgICAgICAgICAgIElYX05QRURMX1dBUk5JTkdfUkVQT1JUICgiaXhOcGVEbE5wZUV4ZWN1dGlvblN0YXJ0IC0gV2FybmluZzpOUEVDIGRvZXMgbm90IHByZXNlbnQuXG4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSAvKiBlbmQgb2YgZWxzZWlmKElYX05QRURMX05QRUlEX05QRUMpICovCisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyogSW52YWxpZCBOUEUgSUQgKi8KKyAgICAgICAgICAgIElYX05QRURMX0VSUk9SX1JFUE9SVCAoIml4TnBlRGxOcGVFeGVjdXRpb25TdGFydCAtIGludmFsaWQgTnBlIElEXG4iKTsKKyAgICAgICAgICAgIHJld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gICAgICAgIC8qIE5QRSBBIGRvZXMgbm90IHByZXNlbnQgKi8KKyAgICAgICAgICAgICAgICBJWF9OUEVETF9XQVJOSU5HX1JFUE9SVCAoIml4TnBlRGxOcGVFeGVjdXRpb25TdG9wIC0gV2FybmluZzpOUEVBIGRvZXMgbm90IHByZXNlbnQuXG4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSAvKiBlbmQgb2YgaWYoSVhfTlBFRExfTlBFSURfTlBFQSkgKi8KKyAgICAgICAgZWxzZSBpZiAoSVhfTlBFRExfTlBFSURfTlBFQiA9PSBucGVJZCkKKyAgICAgICAgeworICAgICAgICAgICAgLyogQ2hlY2sgd2hldGhlciBOUEUgQiBpcyBwcmVzZW50ICovCisgICAgICAgICAgICBpZiAoaXhGZWF0dXJlQ3RybENvbXBvbmVudENoZWNrKElYX0ZFQVRVUkVDVFJMX05QRUIpPT0KKyAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0RJU0FCTEVEKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIE5QRSBCIGRvZXMgbm90IHByZXNlbnQgKi8KKyAgICAgICAgICAgICAgICBJWF9OUEVETF9XQVJOSU5HX1JFUE9SVCAoIml4TnBlRGxOcGVFeGVjdXRpb25TdG9wIC0gV2FybmluZzpOUEVCIGRvZXMgbm90IHByZXNlbnQuXG4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSAvKiBlbmQgb2YgZWxzZWlmKElYX05QRURMX05QRUlEX05QRUIpICovCisgICAgICAgIGVsc2UgaWYgKElYX05QRURMX05QRUlEX05QRUMgPT0gbnBlSWQpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIENoZWNrIHdoZXRoZXIgTlBFIEMgaXMgcHJlc2VudCAqLworICAgICAgICAgICAgaWYgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9OUEVDKT09CisgICAgICAgICAgICAgICAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiBOUEUgQyBkb2VzIG5vdCBwcmVzZW50ICovCisgICAgICAgICAgICAgICAgSVhfTlBFRExfV0FSTklOR19SRVBPUlQgKCJpeE5wZURsTnBlRXhlY3V0aW9uU3RvcCAtIFdhcm5pbmc6TlBFQyBkb2VzIG5vdCBwcmVzZW50LlxuIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIElYX1NVQ0NFU1M7CisgICAgICAgICAgICB9CisgICAgICAgIH0gLyogZW5kIG9mIGVsc2VpZihJWF9OUEVETF9OUEVJRF9OUEVDKSAqLworICAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIEludmFsaWQgTlBFIElEICovCisgICAgICAgICAgICBJWF9OUEVETF9FUlJPUl9SRVBPUlQgKCJpeE5wZURsTnBlRXhlY3V0aW9uU3RvcCAtIGludmFsaWQgTnBlIElEXG4iKTsKKyAgICAgICAgICAgIHN0YXR1cyA9IElYX05QRURMX1BBUkFNX0VSUjsKKyAgICAgICAgfSAvKiBlbmQgb2YgaWYtZWxzZShJWF9OUEVETF9OUEVJRF9OUEVDKSAqLworICAgIH0gLyogZW5kIG9mIGlmIG5vdCBJWFA0MlgtQU8gU2lsaWNvbiAqLworCisgICAgaWYgKHN0YXR1cyA9PSBJWF9TVUNDRVNTKQorICAgIHsKKyAgICAgICAgLyogY2FsbCBOcGVNZ3IgZnVuY3Rpb24gdG8gc3RvcCB0aGUgTlBFICovCisgICAgICAgIHN0YXR1cyA9IGl4TnBlRGxOcGVNZ3JOcGVTdG9wIChucGVJZCk7CisgICAgfQorCisgICAgSVhfTlBFRExfVFJBQ0UxIChJWF9OUEVETF9GTl9FTlRSWV9FWElULAorICAgICAgICAgICAgICAgICAgICAgIkV4aXRpbmcgaXhOcGVEbE5wZUV4ZWN1dGlvblN0b3AgOiBzdGF0dXMgPSAlZFxuIiwKKyAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyk7CisKKyAgICBpZiAoSVhfU1VDQ0VTUyA9PSBzdGF0dXMpCisgICAgeworICAgICAgICAvKiBJbmRpY2F0ZSBOUEUgaGFzIGJlZW4gc3RvcHBlZCAqLworICAgICAgICBpeE5wZURsTnBlU3RhcnRlZFtucGVJZF0gPSBGQUxTRSA7CisgICAgfQorCisgICAgcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqIEZ1bmN0aW9uIGRlZmluaXRpb246IGl4TnBlRGxVbmxvYWQKKyAqLworUFVCTElDIElYX1NUQVRVUworaXhOcGVEbFVubG9hZCAodm9pZCkKK3sKKyAgICBJWF9TVEFUVVMgc3RhdHVzOworCisgICAgSVhfTlBFRExfVFJBQ0UwIChJWF9OUEVETF9GTl9FTlRSWV9FWElULAorICAgICAgICAgICAgICAgICAgICAgIkVudGVyaW5nIGl4TnBlRGxVbmxvYWRcbiIpOworCisgICAgc3RhdHVzID0gaXhOcGVEbE5wZU1nclVuaW5pdCgpOworCisgICAgSVhfTlBFRExfVFJBQ0UxIChJWF9OUEVETF9GTl9FTlRSWV9FWElULAorICAgICAgICAgICAgICAgICAgICAgIkV4aXRpbmcgaXhOcGVEbFVubG9hZCA6IHN0YXR1cyA9ICVkXG4iLAorICAgICAgICAgICAgICAgICAgICAgc3RhdHVzKTsKKyAgICByZXR1cm4gc3RhdHVzOworfQorCisvKgorICogRnVuY3Rpb24gZGVmaW5pdGlvbjogaXhOcGVEbFN0YXRzU2hvdworICovCitQVUJMSUMgdm9pZAoraXhOcGVEbFN0YXRzU2hvdyAodm9pZCkKK3sKKyAgICBpeE9zYWxMb2cgKElYX09TQUxfTE9HX0xWTF9VU0VSLAorICAgICAgICAgICAgICAgSVhfT1NBTF9MT0dfREVWX1NURE9VVCwKKyAgICAgICAgICAgICAgICJcbml4TnBlRGxTdGF0c1Nob3c6XG4iCisgICAgICAgICAgICAgICAiXHREb3dubG9hZHMgQXR0ZW1wdGVkIGJ5IHVzZXI6ICV1XG4iCisgICAgICAgICAgICAgICAiXHRTdWNjZXNzZnVsIERvd25sb2FkczogJXVcbiIKKyAgICAgICAgICAgICAgICJcdEZhaWxlZCBEb3dubG9hZHMgKGR1ZSB0byBDcml0aWNhbCBFcnJvcik6ICV1XG5cbiIsCisgICAgICAgICAgICAgICBpeE5wZURsU3RhdHMuYXR0ZW1wdGVkRG93bmxvYWRzLAorICAgICAgICAgICAgICAgaXhOcGVEbFN0YXRzLnN1Y2Nlc3NmdWxEb3dubG9hZHMsCisgICAgICAgICAgICAgICBpeE5wZURsU3RhdHMuY3JpdGljYWxGYWlsRG93bmxvYWRzLAorICAgICAgICAgICAgICAgMCwwLDApOworCisgICAgaXhOcGVEbEltYWdlTWdyU3RhdHNTaG93ICgpOworICAgIGl4TnBlRGxOcGVNZ3JTdGF0c1Nob3cgKCk7Cit9CisKKy8qCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeE5wZURsU3RhdHNSZXNldAorICovCitQVUJMSUMgdm9pZAoraXhOcGVEbFN0YXRzUmVzZXQgKHZvaWQpCit7CisgICAgaXhOcGVEbFN0YXRzLmF0dGVtcHRlZERvd25sb2FkcyA9IDA7CisgICAgaXhOcGVEbFN0YXRzLnN1Y2Nlc3NmdWxEb3dubG9hZHMgPSAwOworICAgIGl4TnBlRGxTdGF0cy5jcml0aWNhbEZhaWxEb3dubG9hZHMgPSAwOworCisgICAgaXhOcGVEbEltYWdlTWdyU3RhdHNSZXNldCAoKTsKKyAgICBpeE5wZURsTnBlTWdyU3RhdHNSZXNldCAoKTsKK30KKworLyoKKyAqIEZ1bmN0aW9uIGRlZmluaXRpb246IGl4TnBlRGxOcGVJbml0QW5kU3RhcnRJbnRlcm5hbAorICovCitQUklWQVRFIElYX1NUQVRVUworaXhOcGVEbE5wZUluaXRBbmRTdGFydEludGVybmFsIChVSU5UMzIgKmltYWdlTGlicmFyeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVUlOVDMyIGltYWdlSWQpCit7CisgICAgVUlOVDMyICAgICAgICBpbWFnZVNpemU7CisgICAgVUlOVDMyICAgICAgICppbWFnZUNvZGVQdHIgID0gTlVMTDsKKyAgICBJWF9TVEFUVVMgICAgIHN0YXR1czsKKyAgICBJeE5wZURsTnBlSWQgIG5wZUlkID0gSVhfTlBFRExfTlBFSURfRlJPTV9JTUFHRUlEX0dFVChpbWFnZUlkKTsKKyAgICBJeEZlYXR1cmVDdHJsRGV2aWNlSWQgZGV2aWNlSWQgPSBJWF9OUEVETF9ERVZJQ0VJRF9GUk9NX0lNQUdFSURfR0VUKGltYWdlSWQpOworCisgICAgSVhfTlBFRExfVFJBQ0UwIChJWF9OUEVETF9GTl9FTlRSWV9FWElULAorICAgICAgICAgICAgICAgICAgICAgIkVudGVyaW5nIGl4TnBlRGxOcGVJbml0QW5kU3RhcnRJbnRlcm5hbFxuIik7CisKKyAgICBpeE5wZURsU3RhdHMuYXR0ZW1wdGVkRG93bmxvYWRzKys7CisKKyAgICAvKiBDaGVjayBpbnB1dCBwYXJhbWV0ZXIgZGV2aWNlIGNvcnJlY3RuZXNzICovCisgICAgaWYgKChkZXZpY2VJZCA+PSBJWF9GRUFUVVJFX0NUUkxfREVWSUNFX1RZUEVfTUFYKSB8fAorICAgICAgICAoZGV2aWNlSWQgPCBJWF9GRUFUVVJFX0NUUkxfREVWSUNFX1RZUEVfSVhQNDJYKSkKKyAgICB7CisgICAgICAgIHN0YXR1cyA9IElYX05QRURMX1BBUkFNX0VSUjsKKyAgICAgICAgSVhfTlBFRExfRVJST1JfUkVQT1JUICgiaXhOcGVEbE5wZUluaXRBbmRTdGFydEludGVybmFsIC0gIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpbnZhbGlkIHBhcmFtZXRlclxuIik7CisgICAgfSAvKiBFbmQgdmFsaWQgZGV2aWNlIGlkIGNoZWNraW5nICovCisKKyAgICAvKiBDaGVjayBpbnB1dCBwYXJhbWV0ZXJzICovCisgICAgZWxzZSBpZiAoKG5wZUlkID49IElYX05QRURMX05QRUlEX01BWCkgfHwgKG5wZUlkIDwgMCkpCisgICAgeworICAgICAgICBzdGF0dXMgPSBJWF9OUEVETF9QQVJBTV9FUlI7CisgICAgICAgIElYX05QRURMX0VSUk9SX1JFUE9SVCAoIml4TnBlRGxOcGVJbml0QW5kU3RhcnRJbnRlcm5hbCAtICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiaW52YWxpZCBwYXJhbWV0ZXJcbiIpOworICAgIH0KKworICAgIGVsc2UKKyAgICB7CisgICAgICAgIC8qIEVuc3VyZSBpbml0aWFsaXNhdGlvbiBoYXMgYmVlbiBjb21wbGV0ZWQgKi8KKyAgICAgICAgaXhOcGVEbE5wZU1nckluaXQoKTsKKworICAgICAgICAvKiBDaGVja2luZyBpZiBpbWFnZSBiZWluZyBsb2FkZWQgaXMgbWVhbnQgZm9yIGRldmljZSB0aGF0IGlzIHJ1bm5pbmcuCisgICAgICAgICAqIEltYWdlIGlzIGZvcndhcmQgY29tcGF0aWJsZS4gaS5lIEltYWdlIGJ1aWx0IGZvciBJWFA0Mlggc2hvdWxkIHJ1bgorICAgICAgICAgKiBvbiBJWFA0NlggYnV0IG5vdCB2aWNlIHZlcnNhLiovCisgICAgICAgIGlmIChkZXZpY2VJZCA+IChpeEZlYXR1cmVDdHJsRGV2aWNlUmVhZCgpICYgSVhfRkVBVFVSRV9DVFJMX0RFVklDRV9UWVBFX01BU0spKQorICAgICAgICB7CisgICAgICAgICAgICBJWF9OUEVETF9FUlJPUl9SRVBPUlQgKCJpeE5wZURsTnBlSW5pdEFuZFN0YXJ0SW50ZXJuYWwgLSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJEZXZpY2UgdHlwZSBtaXNtYXRjaC4gTlBFIEltYWdlIG5vdCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJtZWFudCBmb3IgZGV2aWNlIGluIHVzZSBcbiIpOworICAgICAgICAgICAgcmV0dXJuIElYX05QRURMX0RFVklDRV9FUlI7CisgICAgICAgIH0vKiBpZiBzdGF0ZW1lbnQgLSBtYXRjaGluZyBpbWFnZSBkZXZpY2UgYW5kIGN1cnJlbnQgZGV2aWNlICovCisKKwkvKiBJZiBub3QgSVhQNDJYIEEwIHN0ZXBwaW5nLCBwcm9jZWVkIHRvIGNoZWNrIGZvciBleGlzdGVuY2Ugb2YgbnBlJ3MgKi8KKwlpZiAoKElYX0ZFQVRVUkVfQ1RSTF9TSUxJQ09OX1RZUEVfQTAgIT0KKwkgICAgIChpeEZlYXR1cmVDdHJsUHJvZHVjdElkUmVhZCgpICYgSVhfRkVBVFVSRV9DVFJMX1NJTElDT05fU1RFUFBJTkdfTUFTSykpCisJICAgIHx8IChJWF9GRUFUVVJFX0NUUkxfREVWSUNFX1RZUEVfSVhQNDJYICE9IGl4RmVhdHVyZUN0cmxEZXZpY2VSZWFkICgpKSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKG5wZUlkID09IElYX05QRURMX05QRUlEX05QRUEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGl4RmVhdHVyZUN0cmxDb21wb25lbnRDaGVjayhJWF9GRUFUVVJFQ1RSTF9OUEVBKSA9PQorICAgICAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0RJU0FCTEVEKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgSVhfTlBFRExfV0FSTklOR19SRVBPUlQoIldhcm5pbmc6IHRoZSBOUEUgQSBjb21wb25lbnQgeW91IHNwZWNpZmllZCBkb2VzIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIG5vdCBleGlzdFxuIik7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBJWF9TVUNDRVNTOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gLyogZW5kIG9mIGlmKG5wZUlkKSAqLworICAgICAgICAgICAgZWxzZSBpZiAobnBlSWQgPT0gSVhfTlBFRExfTlBFSURfTlBFQikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZiAoaXhGZWF0dXJlQ3RybENvbXBvbmVudENoZWNrKElYX0ZFQVRVUkVDVFJMX05QRUIpPT0KKyAgICAgICAgICAgICAgICAgICAgSVhfRkVBVFVSRV9DVFJMX0NPTVBPTkVOVF9ESVNBQkxFRCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIElYX05QRURMX1dBUk5JTkdfUkVQT1JUKCJXYXJuaW5nOiB0aGUgTlBFIEIgY29tcG9uZW50IHlvdSBzcGVjaWZpZWQiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgZG9lcyBub3QgZXhpc3RcbiIpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IC8qIGVuZCBvZiBlbHNlaWYobnBlSWQpICovCisgICAgICAgICAgICBlbHNlIGlmIChucGVJZCA9PSBJWF9OUEVETF9OUEVJRF9OUEVDKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChpeEZlYXR1cmVDdHJsQ29tcG9uZW50Q2hlY2soSVhfRkVBVFVSRUNUUkxfTlBFQyk9PQorICAgICAgICAgICAgICAgICAgICBJWF9GRUFUVVJFX0NUUkxfQ09NUE9ORU5UX0RJU0FCTEVEKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgSVhfTlBFRExfV0FSTklOR19SRVBPUlQoIldhcm5pbmc6IHRoZSBOUEUgQyBjb21wb25lbnQgeW91IHNwZWNpZmllZCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiBkb2VzIG5vdCBleGlzdFxuIik7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBJWF9TVUNDRVNTOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gLyogZW5kIG9mIGVsc2VpZihucGVJZCkgKi8KKyAgICAgICAgfSAvKiBlbmQgb2YgaWYgbm90IElYUDQyWC1BMCBTaWxpY29uICovCisKKyAgICAgICAgLyogc3RvcCBhbmQgcmVzZXQgdGhlIE5QRSAqLworICAgICAgICBzdGF0dXMgPSBpeE5wZURsTnBlU3RvcEFuZFJlc2V0IChucGVJZCk7CisgICAgICAgIGlmIChJWF9TVUNDRVNTICE9IHN0YXR1cykKKyAgICAgICAgeworICAgICAgICAgICAgSVhfTlBFRExfRVJST1JfUkVQT1JUICgiRmFpbGVkIHRvIHN0b3AgYW5kIHJlc2V0IE5QRVxuIik7CisgICAgICAgICAgICByZXR1cm4gc3RhdHVzOworICAgICAgICB9CisKKyAgICAgICAgLyogTG9jYXRlIGltYWdlICovCisgICAgICAgIHN0YXR1cyA9IGl4TnBlRGxJbWFnZU1nckltYWdlRmluZCAoaW1hZ2VMaWJyYXJ5LCBpbWFnZUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZpbWFnZUNvZGVQdHIsICZpbWFnZVNpemUpOworICAgICAgICBpZiAoSVhfU1VDQ0VTUyA9PSBzdGF0dXMpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiBJZiBkb3dubG9hZCB3YXMgc3VjY2Vzc2Z1bCwgc3RvcmUgaW1hZ2UgSWQgaW4gbGlzdCBvZgorICAgICAgICAgICAgICogY3VycmVudGx5IGxvYWRlZCBpbWFnZXMuIElmIGEgY3JpdGljYWwgZXJyb3Igb2NjdXJlZAorICAgICAgICAgICAgICogZHVyaW5nIGRvd25sb2FkLCByZWNvcmQgdGhhdCB0aGUgTlBFIGhhcyBhbiBpbnZhbGlkIGltYWdlCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHN0YXR1cyA9IGl4TnBlRGxOcGVNZ3JJbWFnZUxvYWQgKG5wZUlkLCBpbWFnZUNvZGVQdHIsIFRSVUUpOworICAgICAgICAgICAgaWYgKElYX1NVQ0NFU1MgPT0gc3RhdHVzKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGl4TnBlRGxOcGVTdGF0ZVtucGVJZF0udmFsaWRJbWFnZSA9IFRSVUU7CisgICAgICAgICAgICAgICAgaXhOcGVEbFN0YXRzLnN1Y2Nlc3NmdWxEb3dubG9hZHMrKzsKKworICAgICAgICAgICAgICAgIHN0YXR1cyA9IGl4TnBlRGxOcGVFeGVjdXRpb25TdGFydCAobnBlSWQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiAoKHN0YXR1cyA9PSBJWF9OUEVETF9DUklUSUNBTF9OUEVfRVJSKSB8fAorICAgICAgICAgICAgICAgICAgICAgKHN0YXR1cyA9PSBJWF9OUEVETF9DUklUSUNBTF9NSUNST0NPREVfRVJSKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpeE5wZURsTnBlU3RhdGVbbnBlSWRdLnZhbGlkSW1hZ2UgPSBGQUxTRTsKKyAgICAgICAgICAgICAgICBpeE5wZURsU3RhdHMuY3JpdGljYWxGYWlsRG93bmxvYWRzKys7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qIE5PVEUgLSBUaGUgZm9sbG93aW5nIHNlY3Rpb24gb2YgY29kZSBpcyBoZXJlIHRvIHN1cHBvcnQKKyAgICAgICAgICAgICAqIGEgZGVwcmVjYXRlZCBmdW5jdGlvbiBpeE5wZURsTG9hZGVkSW1hZ2VHZXQoKS4gIFdoZW4gdGhhdAorICAgICAgICAgICAgICogZnVuY3Rpb24gaXMgcmVtb3ZlZCBmcm9tIHRoZSBBUEksIHRoaXMgY29kZSBzaG91bGQgYmUgcmV2aXNlZC4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaXhOcGVEbE5wZVN0YXRlW25wZUlkXS5pbWFnZUlkLm5wZUlkID0gbnBlSWQ7CisgICAgICAgICAgICBpeE5wZURsTnBlU3RhdGVbbnBlSWRdLmltYWdlSWQuZnVuY3Rpb25hbGl0eUlkID0KKyAgICAgICAgICAgICAgICBJWF9OUEVETF9GVU5DVElPTklEX0ZST01fSU1BR0VJRF9HRVQoaW1hZ2VJZCk7CisgICAgICAgICAgICBpeE5wZURsTnBlU3RhdGVbbnBlSWRdLmltYWdlSWQubWFqb3IgPQorICAgICAgICAgICAgICAgIElYX05QRURMX01BSk9SX0ZST01fSU1BR0VJRF9HRVQoaW1hZ2VJZCk7CisgICAgICAgICAgICBpeE5wZURsTnBlU3RhdGVbbnBlSWRdLmltYWdlSWQubWlub3IgPQorICAgICAgICAgICAgICAgIElYX05QRURMX01JTk9SX0ZST01fSU1BR0VJRF9HRVQoaW1hZ2VJZCk7CisgICAgICAgIH0gLyogZW5kIG9mIGlmKElYX1NVQ0NFU1MpICovIC8qIGNvbmRpdGlvbjogaW1hZ2UgbG9jYXRlZCBzdWNjZXNzZnVsbHkgaW4gbWljcm9jb2RlIGltYWdlICovCisgICAgfSAvKiBlbmQgb2YgaWYtZWxzZShucGVJZC1kZXZpY2VJZCkgKi8gLyogY29uZGl0aW9uOiBwYXJhbWV0ZXIgY2hlY2tzIG9rICovCisKKyAgICBJWF9OUEVETF9UUkFDRTEgKElYX05QRURMX0ZOX0VOVFJZX0VYSVQsCisgICAgICAgICAgICAgICAgICAgICAiRXhpdGluZyBpeE5wZURsTnBlSW5pdEFuZFN0YXJ0SW50ZXJuYWwgOiAiCisgICAgICAgICAgICAgICAgICAgICAic3RhdHVzID0gJWRcbiIsIHN0YXR1cyk7CisgICAgcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqIEZ1bmN0aW9uIGRlZmluaXRpb246IGl4TnBlRGxDdXN0b21JbWFnZU5wZUluaXRBbmRTdGFydAorICovCitQVU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lRGxOcGVJZCBucGVJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVJTlQ4ICpmdW5jdGlvbmFsaXR5SWQpCit7CisgICAgLyogQ2hlY2sgaW5wdXQgcGFyYW1ldGVycyAqLworICAgIGlmICgobnBlSWQgPj0gSVhfTlBFRExfTlBFSURfTUFYKSB8fCAobnBlSWQgPCAwKSkKKyAgICB7CisgICAgICAgIElYX05QRURMX0VSUk9SX1JFUE9SVCAoIml4TnBlRGxMb2FkZWRJbWFnZUZ1bmN0aW9uYWxpdHlHZXQgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICItIGludmFsaWQgcGFyYW1ldGVyXG4iKTsKKyAgICAgICAgcmV0dXJuIElYX05QRURMX1BBUkFNX0VSUjsKKyAgICB9CisgICAgaWYgKGZ1bmN0aW9uYWxpdHlJZCA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgSVhfTlBFRExfRVJST1JfUkVQT1JUICgiaXhOcGVEbExvYWRlZEltYWdlRnVuY3Rpb25hbGl0eUdldCAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIi0gaW52YWxpZCBwYXJhbWV0ZXJcbiIpOworICAgICAgICByZXR1cm4gSVhfTlBFRExfUEFSQU1fRVJSOworICAgIH0KKworICAgIGlmIChpeE5wZURsTnBlU3RhdGVbbnBlSWRdLnZhbGlkSW1hZ2UpCisgICAgeworICAgICAgICAqZnVuY3Rpb25hbGl0eUlkID0gaXhOcGVEbE5wZVN0YXRlW25wZUlkXS5pbWFnZUlkLmZ1bmN0aW9uYWxpdHlJZDsKKyAgICAgICAgcmV0dXJuIElYX1NVQ0NFU1M7CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHJldHVybiBJWF9GQUlMOworICAgIH0KK30KZGlmZiAtLWdpdCBhL2NwdS9peHAvbnBlL0l4TnBlRGxJbWFnZU1nci5jIGIvY3B1L2l4cC9ucGUvSXhOcGVEbEltYWdlTWdyLmMKbmV3I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aW1hZ2VJZC0+bWFqb3IgPD0gZm9ybWF0dGVkSW1hZ2VJZC5tYWpvcikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmKGltYWdlSWQtPm1pbm9yIDwgZm9ybWF0dGVkSW1hZ2VJZC5taW5vcikKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2VJZC0+bWlub3IgPSBmb3JtYXR0ZWRJbWFnZUlkLm1pbm9yOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGltYWdlSWQtPm1ham9yID0gZm9ybWF0dGVkSW1hZ2VJZC5tYWpvcjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc3RhdHVzID0gSVhfU1VDQ0VTUzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGltYWdlQ291bnQrKzsKKwl9CisJaWYgKHN0YXR1cyAhPSBJWF9TVUNDRVNTKQorCXsKKwkgICAgSVhfTlBFRExfRVJST1JfUkVQT1JUICgiaXhOcGVEbEltYWdlTWdyTGF0ZXN0SW1hZ2VFeHRyYWN0OiAiCisJCQkJICAgImltYWdlSWQgbm90IGZvdW5kIGluIGltYWdlIGxpYnJhcnkgaGVhZGVyXG4iKTsKKwkgICAgaXhOcGVEbEltYWdlTWdyU3RhdHMuaW1hZ2VJZE5vdEZvdW5kKys7CisJfQorICAgIH0KKyAgICBlbHNlCisgICAgeworCUlYX05QRURMX0VSUk9SX1JFUE9SVCAoIml4TnBlRGxJbWFnZU1nckxhdGVzdEltYWdlR2V0OiAiCisJCQkgICAgICAgImludmFsaWQgc2lnbmF0dXJlIGluIGltYWdlIGxpYnJhcnlcbiIpOworICAgIH0KKworICAgIElYX05QRURMX1RSQUNFMSAoSVhfTlBFRExfRk5fRU5UUllfRVhJVCwKKwkJICAgICAiRXhpdGluZyBpeE5wZURsSW1hZ2VNZ3JMYXRlc3RJbWFnZUdldDogc3RhdHVzID0g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JTdGF0cy5pbnN0cnVjdGlvbkJsb2Nrc0xvYWRlZCwKKyAgICAgICAgICAgICAgIGl4TnBlRGxOcGVNZ3JTdGF0cy5kYXRhQmxvY2tzTG9hZGVkLAorICAgICAgICAgICAgICAgaXhOcGVEbE5wZU1nclN0YXRzLnN0YXRlSW5mb0Jsb2Nrc0xvYWRlZCwKKyAgICAgICAgICAgICAgIGl4TnBlRGxOcGVNZ3JTdGF0cy5jcml0aWNhbE5wZUVycm9ycywKKyAgICAgICAgICAgICAgIGl4TnBlRGxOcGVNZ3JTdGF0cy5jcml0aWNhbE1pY3JvY29kZUVycm9ycywKKyAgICAgICAgICAgICAgIDApOworCisgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfVVNFUiwKKyAgICAgICAgICAgICAgIElYX09TQUxfTE9HX0RFVl9TVERPVVQsCisgICAgICAgICAgICAgICAiXHRTdWNjZXNzZnVsIE5QRSBTdGFydHM6ICV1XG4iCisgICAgICAgICAgICAgICAiXHRTdWNjZXNzZnVsIE5QRSBTdG9wczogJXVcbiIKKyAgICAgICAgICAgICAgICJcdFN1Y2Nlc3NmdWwgTlBFIFJlc2V0czogJXVcblxuIiwKKyAgICAgICAgICAgICAgIGl4TnBlRGxOcGVNZ3JTdGF0cy5ucGVTdGFydHMsCisgICAgICAgICAgICAgICBpeE5wZURsTnBlTWdyU3RhdHMubnBlU3RvcHMsCisgICAgICAgICAgICAgICBpeE5wZURsTnBlTWdyU3RhdHMubnBlUmVzZXRzLAorICAgICAgICAgICAgICAgMCwwLDApOworCisgICAgaXhOcGVEbE5wZU1nclV0aWxzU3RhdHNTaG93ICgpOworfQorCisKKy8qCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeE5wZURsTnBlTWdyU3RhdHNSZXNldAorICovCit2b2lkCitpeE5wZURsTnBlTWdyU3RhdHNSZXNldCAodm9pZCkKK3sKKyAgICBpeE5wZURsTnBlTWdyU3RhdHMuaW5zdHJ1Y3Rpb25CbG9ja3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E9VVCBPRiBUSEUgVVNFIE9GIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YKKyAqIFNVQ0ggREFNQUdFLgorICogCisgKiBAcGFyCisgKiAtLSBFbmQgb2YgQ29weXJpZ2h0IE5vdGljZSAtLQorKi8KKworCisvKgorICogUHV0IHRoZSBzeXN0ZW0gZGVmaW5lZCBpbmNsdWRlIGZpbGVzIHJlcXVpcmVkLgorICovCisjZGVmaW5lIElYX05QRV9ETF9NQVhfTlVNX09GX1JFVFJJRVMgMTAwMDAwMCAvKio8IE1heGltdW0gbnVtYmVyIG9mCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiByZXRyaWVzIGJlZm9yZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogdGltZW91dAorCQkJCQkgICAgICAgICAgICAgICAgICAgICAgICAgICovICAKKworLyoKKyAqIFB1dCB0aGUgdXNlciBkZWZpbmVkIGluY2x1ZGUgZmlsZXMgcmVxdWlyZWQuCisgKi8KKyNpbmNsdWRlICJJeE9zYWwuaCIKKyNpbmNsdWRlICJJeE5wZURsLmgiCisjaW5jbHVkZSAiSXhOcGVEbE5wZU1nclV0aWxzX3AuaCIKKyNpbmNsdWRlICJJeE5wZURsTnBlTWdyRWNSZWdpc3RlcnNfcC5oIgorI2luY2x1ZGUgIkl4TnBlRGxNYWNyb3NfcC5oIgorCisvKgorICogI2RlZmluZXMgYW5kIG1hY3JvcyB1c2VkIGluIHRoaXMgZmlsZS4KKyAqLworCisvKiB1c2VkIHRvIGJpdC1tYXNrIGEgbnVtYmVyIG9mIGJ5dGVzICovCisjZGVmaW5lIElYX05QRURMX01BU0tfTE9XRVJfQllURV9PRl9XT1JEICAweDAwMDAwMEZGCisjZGVmaW5lIElYX05QRURMX01BU0tfTE9XRVJfU0hPUlRfT0ZfV09SRCAweDAwMDBGRkZGCisjZGVmaW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nQpIHRvIHxkMnxkM3wgKi8KKwlzdGF0dXMgPSBpeE5wZURsTnBlTWdyTG9naWNhbFJlZ1dyaXRlIChucGVCYXNlQWRkcmVzcywKKwkJCQkgICAgICByZWdBZGRyICsgSVhfTlBFRExfQllURVNfUEVSX1NIT1JULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVnVmFsICYgSVhfTlBFRExfTUFTS19MT1dFUl9TSE9SVF9PRl9XT1JELAorCQkJCSAgICAgIElYX05QRURMX1JFR19TSVpFX1NIT1JULAorCQkJCSAgICAgIGN0eHROdW0sIHZlcmlmeSk7CisgICAgCisgICAgaWYgKElYX1NVQ0NFU1MgIT0gc3RhdHVzKQorCXsKKwkgICAgcmV0dXJuIHN0YXR1czsKKwl9CisJfQorICAgIGVsc2UKKyAgICB7CisgICAgICAgIHN3aXRjaCAocmVnU2l6ZSkKKwl7IAorCWNhc2UgSVhfTlBFRExfUkVHX1NJWkVfQllURToKKwkgICAgbnBlSW5zdHJ1Y3Rpb24gPSBJWF9OUEVETF9JTlNUUl9XUl9SRUdfQllURTsKKwkgICAgbWFzayA9IElYX05QRURMX01BU0tfTE9XRVJfQllURV9PRl9XT1JEOyAgYnJlYWs7CisJY2FzZSBJWF9OUEVETF9SRUdfU0laRV9TSE9SVDoKKyAgICAgICAgICAgIG5wZUluc3RydWN0aW9uID0gSVhfTlBFRExfSU5TVFJfV1JfUkVHX1NIT1JUOworCSAgICBtYXNrID0gSVhfTlBFRExfTUFTS19MT1dFUl9TSE9SVF9PRl9XT1JEOyAgYnJlYWs7CisJfQorCS8qIG1hc2sgb3V0IGFueSByZWR1bmRhbnQgYml0cywgc28gdmVyaWZ5IHdpbGwgd29yayBsYXRlciAqLworCXJlZ1ZhbCAmPSBtYXNrOworCisJLyogZmlsbCBkZXN0IG9wZXJhbmQgZmllbGQgb2YgIGluc3RydWN0aW9uIHdpdGggZGVzdGluYXRpb24gcmVnIGFkZHIgKi8KKwlucGVJbnN0cnVjdGlvb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24gTWVtb3J5IHdyaXRlczogJXVcbiIKKyAgICAgICAgICAgICAgICJcdEluc3RydWN0aW9uIE1lbW9yeSB3cml0ZXMgZmFpbGVkOiAldVxuIgorICAgICAgICAgICAgICAgIlx0RGF0YSBNZW1vcnkgd3JpdGVzOiAldVxuIgorICAgICAgICAgICAgICAgIlx0RGF0YSBNZW1vcnkgd3JpdGVzIGZhaWxlZDogJXVcbiIsCisgICAgICAgICAgICAgICBpeE5wZURsTnBlTWdyVXRpbHNTdGF0cy5pbnNNZW1Xcml0ZXMsCisgICAgICAgICAgICAgICBpeE5wZURsTnBlTWdyVXRpbHNTdGF0cy5pbnNNZW1Xcml0ZUZhaWxzLAorICAgICAgICAgICAgICAgaXhOcGVEbE5wZU1nclV0aWxzU3RhdHMuZGF0YU1lbVdyaXRlcywKKyAgICAgICAgICAgICAgIGl4TnBlRGxOcGVNZ3JVdGlsc1N0YXRzLmRhdGFNZW1Xcml0ZUZhaWxzLAorICAgICAgICAgICAgICAgMCwwKTsKKworICAgIGl4T3NhbExvZyAoSVhfT1NBTF9MT0dfTFZMX1VTRVIsCisgICAgICAgICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RET1VULAorICAgICAgICAgICAgICAgIlx0RXhlY3V0aW5nIENvbnRleHQgU3RhY2sgUmVnaXN0ZXIgd3JpdGVzOiAldVxuIgorICAgICAgICAgICAgICAgIlx0RXhlY3V0aW5nIENvbnRleHQgU3RhY2sgUmVnaXN0ZXIgcmVhZHM6ICV1XG4iCisgICAgICAgICAgICAgICAiXHRQaHlzaWNhbCBSZWdpc3RlciB3cml0ZXM6ICV1XG4iCisgICAgICAgICAgICAgICAiXHRDb250ZXh0IFN0b3JlIFJlZ2lzdGVyIHdyaXRlczogJXVcbiIKKyAgICAgICAgICAgICAgICJcdEV4ZWN1dGlvbiBCYWNrZ291bmQgQ29udGV4dCBOZXh0UEMgd3JpdGVzOiAldVxuIgorICAgICAgICAgICAgICAgIlx0RGVidWcgSW5zdHJ1Y3Rp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FTUhfVFJBQ0UwIChJWF9OUEVNSF9GTl9FTlRSWV9FWElULCAiRW50ZXJpbmcgIgorICAgICAgICAgICAgICAgICAgICAgIml4TnBlTWhNZXNzYWdlU2VuZFxuIik7CisKKyAgICAvKiBjaGVjayB0aGF0IHdlIGFyZSBpbml0aWFsaXplZCAqLworICAgIGlmICghaXhOcGVNaEluaXRpYWxpemVkKQorICAgIHsKKyAgICAgICAgSVhfTlBFTUhfRVJST1JfUkVQT1JUICgiSXhOcGVNaCBjb21wb25lbnQgaXMgbm90IGluaXRpYWxpemVkXG4iKTsKKyAgICAgICAgcmV0dXJuIElYX0ZBSUw7CisgICAgfQorCisgICAgLyogY2hlY2sgdGhlIG5wZUlkIHBhcmFtZXRlciAqLworICAgIGlmICghaXhOcGVNaENvbmZpZ05wZUlkSXNWYWxpZCAobnBlSWQpKQorICAgIHsKKyAgICAgICAgSVhfTlBFTUhfRVJST1JfUkVQT1JUICgiTlBFIElEIGludmFsaWRcbiIpOworICAgICAgICByZXR1cm4gSVhfRkFJTDsKKyAgICB9CisKKyAgICAvKiBwYXJhbWV0ZXJzIGFyZSBvayAuLi4gKi8KKworICAgIC8qIGdldCB0aGUgbG9jayB0byBwcmV2ZW50IG90aGVyIGNsaWVudHMgZnJvbSBlbnRlcmluZyAqLworICAgIGl4TnBlTWhDb25maWdMb2NrR2V0IChucGVJZCk7CisKKyAgICAvKiBzZW5kIHRoZSBtZXNzYWdlICovCisgICAgc3RhdHVzID0gaXhOcGVNaFNlbmRNZXNzYWdlU2VuZCAobnBlSWQsIG1lc3NhZ2UsIG1heFNlbmRSZXRyaWVzKTsKKyAgICBpZiAoc3RhdHVzICE9IElYX1NVQ0NFU1MpCisgICAgeworICAgICAgICBJWF9OUEVNSF9FUlJPUl9SRVBPUlQgKCJGYWlsZWQgdG8gc2VuZCBtZXNzYWdlXG4iKTsKKyAgICB9CisKKyAgICAvKiByZWxlYXNlIHRoZSBsb2NrIHRvIGFsbG93IG90aGVyIGNsaWVudHMg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iBJWF9GQUlMOworICAgIH0KKworICAgIC8qIHBhcmFtZXRlcnMgYXJlIG9rIC4uLiAqLworCisgICAgLyogZ2V0IHRoZSBsb2NrIHRvIHByZXZlbnQgb3RoZXIgY2xpZW50cyBmcm9tIGVudGVyaW5nICovCisgICAgaXhOcGVNaENvbmZpZ0xvY2tHZXQgKG5wZUlkKTsKKworICAgIC8qIHJlY2VpdmUgbWVzc2FnZXMgZnJvbSB0aGUgTlBFICovCisgICAgc3RhdHVzID0gaXhOcGVNaFJlY2VpdmVNZXNzYWdlc1JlY2VpdmUgKG5wZUlkKTsKKworICAgIGlmIChzdGF0dXMgIT0gSVhfU1VDQ0VTUykKKyAgICB7CisgICAgICAgIElYX05QRU1IX0VSUk9SX1JFUE9SVCAoIkZhaWxlZCB0byByZWNlaXZlIG1lc3NhZ2VcbiIpOworICAgIH0KKworICAgIC8qIHJlbGVhc2UgdGhlIGxvY2sgdG8gYWxsb3cgb3RoZXIgY2xpZW50cyBiYWNrIGluICovCisgICAgaXhOcGVNaENvbmZpZ0xvY2tSZWxlYXNlIChucGVJZCk7CisKKyAgICBJWF9OUEVNSF9UUkFDRTEgKElYX05QRU1IX0ZOX0VOVFJZX0VYSVQsICJFeGl0aW5nICIKKyAgICAgICAgICAgICAgICAgICAgICJpeE5wZU1oTWVzc2FnZXNSZWNlaXZlIgorICAgICAgICAgICAgICAgICAgICAgIiA6IHN0YXR1cyA9ICVkXG4iLCBzdGF0dXMpOworCisgICAgcmV0dXJuIHN0YXR1czsKK30KKworLyoKKyAqIEZ1bmN0aW9uIGRlZmluaXRpb246IGl4TnBlTWhTaG93CisgKi8KKworUFVCTElDIElYX1NUQVRVUyBpeE5wZU1oU2hvdyAoCisgICAgSXhOcGVNaE5wZUlkIG5wZUlkKQoreworICAgIElYX05QRU1IX1RSQUNFMCAoSVhfTlBFTUhfRk5fRU5UUllfRVhJVCwgIkVudGVyaW5nICIKKyAgICAgICAgICAgICAgICAgICAgICJpeE5wZU1oU2hvd1xuI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GVJZCkKK3sKKyAgICBJWF9OUEVNSF9UUkFDRTAgKElYX05QRU1IX0ZOX0VOVFJZX0VYSVQsICJFbnRlcmluZyAiCisgICAgICAgICAgICAgICAgICAgICAiaXhOcGVNaFNob3dSZXNldFxuIik7CisKKyAgICAvKiBjaGVjayB0aGF0IHdlIGFyZSBpbml0aWFsaXplZCAqLworICAgIGlmICghaXhOcGVNaEluaXRpYWxpemVkKQorICAgIHsKKyAgICAgICAgSVhfTlBFTUhfRVJST1JfUkVQT1JUICgiSXhOcGVNaCBjb21wb25lbnQgaXMgbm90IGluaXRpYWxpemVkXG4iKTsKKyAgICAgICAgcmV0dXJuIElYX0ZBSUw7CisgICAgfQorCisgICAgLyogY2hlY2sgdGhlIG5wZUlkIHBhcmFtZXRlciAqLworICAgIGlmICghaXhOcGVNaENvbmZpZ05wZUlkSXNWYWxpZCAobnBlSWQpKQorICAgIHsKKyAgICAgICAgSVhfTlBFTUhfRVJST1JfUkVQT1JUICgiTlBFIElEIGludmFsaWRcbiIpOworICAgICAgICByZXR1cm4gSVhfRkFJTDsKKyAgICB9CisKKyAgICAvKiBwYXJhbWV0ZXJzIGFyZSBvayAuLi4gKi8KKworICAgIC8qIG5vdGUgd2UgZG9uJ3QgZ2V0IHRoZSBsb2NrIGhlcmUgYXMgcmVzZXR0aW5nIHRoZSBzdGF0aXN0aWNzICovCisgICAgLyogc2hvdWxkbid0IGltcGFjdCBzeXN0ZW0gcGVyZm9ybWFuY2UuICovCisKKyAgICAvKiByZXNldCB0aGUgY3VycmVudCBzdGF0ZSBvZiBlYWNoIG1vZHVsZSAqLworCisgICAgLyogcmVzZXQgdGhlIGN1cnJlbnQgc3RhdGUgb2YgdGhlIENvbmZpZ3VyYXRpb24gbW9kdWxlICovCisgICAgaXhOcGVNaENvbmZpZ1Nob3dSZXNldCAobnBlSWQpOworCisgICAgLyogcmVzZXQgdGhlIGN1cnJlbnQgc3RhdGUgb2YgdGhlIFJlY2VpdmUgbW9kdWxlICovCisgICAg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WNzIGZvciB0aGUKKyAqIENvbmZpZ3VyYXRpb24gbW9kdWxlLgorICovCisKK3R5cGVkZWYgc3RydWN0Cit7CisgICAgVUlOVDMyIG91dEZpZm9SZWFkczsgICAgICAgIC8qKjwgb3V0RmlmbyByZWFkcyAqLworICAgIFVJTlQzMiBpbkZpZm9Xcml0ZXM7ICAgICAgICAvKio8IGluRmlmbyB3cml0ZXMgKi8KKyAgICBVSU5UMzIgbWF4SW5GaWZvRnVsbFJldHJpZXM7ICAgLyoqPCBtYXggcmV0cmllcyBpZiBpbkZJRk8gZnVsbCAgICovCisgICAgVUlOVDMyIG1heE91dEZpZm9FbXB0eVJldHJpZXM7IC8qKjwgbWF4IHJldHJpZXMgaWYgb3V0RklGTyBlbXB0eSAqLworfSBJeE5wZU1oQ29uZmlnU3RhdHM7CisKKy8qCisgKiBWYXJpYWJsZSBkZWNsYXJhdGlvbnMgZ2xvYmFsIHRvIHRoaXMgZmlsZSBvbmx5LiAgRXh0ZXJucyBhcmUgZm9sbG93ZWQgYnkKKyAqIHN0YXRpYyB2YXJpYWJsZXMuCisgKi8KKworSXhOcGVNaENvbmZpZ05wZUluZm8gaXhOcGVNaENvbmZpZ05wZUluZm9bSVhfTlBFTUhfTlVNX05QRVNdID0KK3sKKyAgICB7CisgICAgICAgIDAsCisgICAgICAgIElYX05QRU1IX05QRUFfSU5ULAorCTAsCisgICAgICAgIDAsCisgICAgICAgIDAsCisgICAgICAgIDAsCisgICAgICAgIDAsCisgICAgICAgIE5VTEwsCisgICAgICAgIEZBTFNFCisgICAgfSwKKyAgICB7CisgICAgICAgIDAsCisgICAgICAgIElYX05QRU1IX05QRUJfSU5ULAorCTAsCisJMCwKKyAgICAgICAgMCwKKyAgICAgICAgMCwKKyAgICAgICAgMCwKKyAgICAgICAgTlVMTCwKKyAgICAgICAgRkFMU0UKKyAgICB9LAorICAgIHsKKyAgICAgICAgMCwKKyAgICAgICAgSVhfTlBFTUhfTlBFQ19JTlQsCisgICAgICAgIDAsC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aGUgT0ZJTlQgc3RhdHVzIGJpdCBpcyBzZXQgKi8KKyAgICBpZiAob2ZpbnQpCisgICAgeworICAgICAgICAvKiBpZiB0aGVyZSBpcyBhbiBJU1IgcmVnaXN0ZXJlZCBmb3IgdGhpcyBOUEUgKi8KKyAgICAgICAgaWYgKGl4TnBlTWhDb25maWdOcGVJbmZvW25wZUlkXS5pc3IgIT0gTlVMTCkKKyAgICAgICAgeworICAgICAgICAgICAgLyogaW52b2tlIHRoZSBJU1Igcm91dGluZSAqLworICAgICAgICAgICAgaXhOcGVNaENvbmZpZ05wZUluZm9bbnBlSWRdLmlzciAobnBlSWQpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyogaWYgd2UgZG9uJ3Qgc2VydmljZSB0aGUgaW50ZXJydXB0IHRoZSBOUEUgd2lsbCBjb250aW51ZSAqLworICAgICAgICAgICAgLyogdG8gdHJpZ2dlciB0aGUgaW50ZXJydXB0IGluZGVmaW5pdGVseSAqLworICAgICAgICAgICAgSVhfTlBFTUhfRVJST1JfUkVQT1JUICgiTm8gSVNSIHJlZ2lzdGVyZWQgdG8gc2VydmljZSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpbnRlcnJ1cHRcbiIpOworICAgICAgICB9CisgICAgfQorCisgICAgSVhfTlBFTUhfVFJBQ0UwIChJWF9OUEVNSF9GTl9FTlRSWV9FWElULCAiRXhpdGluZyAiCisgICAgICAgICAgICAgICAgICAgICAiaXhOcGVNaENvbmZpZ0lzclxuIik7Cit9CisKKy8qCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeE5wZU1oQ29uZmlnSW5pdGlhbGl6ZQorICovCisKK3ZvaWQgaXhOcGVNaENvbmZpZ0luaXRpYWxpemUgKAorICAgIEl4TnBlTWhOcGVJbnRlcnJ1cHRzIG5wZUludGVycnVwdHMpCit7CisgICAgSXhOcGVNaE5wZUlkIG5wZUlkOworICAgIFVJTlQzMiB2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FDRTIgKElYX05QRU1IX0RFQlVHLCAiTlBFICVkIHN0YXR1cyByZWdpc3RlciAgPSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgIjB4JTA4WFxuIiwgbnBlSWQsIG5wZUluZm8tPnN0YXR1c1JlZ2lzdGVyKTsKKyAgICAgICAgSVhfTlBFTUhfVFJBQ0UyIChJWF9OUEVNSF9ERUJVRywgIk5QRSAlZCBjb250cm9sIHJlZ2lzdGVyID0gIgorICAgICAgICAgICAgICAgICAgICAgICAgICIweCUwOFhcbiIsIG5wZUlkLCBucGVJbmZvLT5jb250cm9sUmVnaXN0ZXIpOworICAgICAgICBJWF9OUEVNSF9UUkFDRTIgKElYX05QRU1IX0RFQlVHLCAiTlBFICVkIGluRmlmbyByZWdpc3RlciAgPSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgIjB4JTA4WFxuIiwgbnBlSWQsIG5wZUluZm8tPmluRmlmb1JlZ2lzdGVyKTsKKyAgICAgICAgSVhfTlBFTUhfVFJBQ0UyIChJWF9OUEVNSF9ERUJVRywgIk5QRSAlZCBvdXRGaWZvIHJlZ2lzdGVyID0gIgorICAgICAgICAgICAgICAgICAgICAgICAgICIweCUwOFhcbiIsIG5wZUlkLCBucGVJbmZvLT5vdXRGaWZvUmVnaXN0ZXIpOworCisgICAgICAgIC8qIGNvbm5lY3Qgb3VyIElTUiB0byB0aGUgTlBFIGludGVycnVwdCAqLworICAgICAgICAodm9pZCkgaXhPc2FsSXJxQmluZCAoCisgICAgICAgICAgICBucGVJbmZvLT5pbnRlcnJ1cHRJZCwgaXhOcGVNaENvbmZpZ0lzciwgKHZvaWQgKilucGVJZCk7CisKKyAgICAgICAgLyogaW5pdGlhbGlzZSBhIG11dGV4IGZvciB0aGlzIE5QRSAqLworICAgICAgICAodm9pZCkgaXhPc2FsTXV0ZXhJbml0ICgmbnBlSW5mby0+bXV0ZXgpOworCisgICAgICAgIC8qIGlmIHdlIHNob3VsZCBzZXJ2aWNlIHRoZSBOUEUncyAib3V0RklGTyBub3QgZW1wdHkiIGludGVycnVwdCAqLworICAgICAgICBpZiAobnBlSW50ZXJydXB0cyA9PSBJWF9OUEVNSF9OUEVJTlRFUlJVUFRTX1lFUykKKyAgICAgICAgeworICAgICAgICAgICAgLyogZW5hYmxlIHRoZSBOUEUncyAib3V0RklGTyBub3QgZW1wdHkiIGludGVycnVwdCAqLworICAgICAgICAgICAgaXhOcGVNaENvbmZpZ05wZUludGVycnVwdEVuYWJsZSAobnBlSWQpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyogZGlzYWJsZSB0aGUgTlBFJ3MgIm91dEZJRk8gbm90IGVtcHR5IiBpbnRlcnJ1cHQgKi8KKyAgICAgICAgICAgIGl4TnBlTWhDb25maWdOcGVJbnRlcnJ1cHREaXNhYmxlIChucGVJZCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBJWF9OUEVNSF9UUkFDRTAgKElYX05QRU1IX0ZOX0VOVFJZX0VYSVQsICJFeGl0aW5nICIKKyAgICAgICAgICAgICAgICAgICAgICJpeE5wZU1oQ29uZmlnSW5pdGlhbGl6ZVxuIik7Cit9CisKKy8qCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeE5wZU1oQ29uZmlnVW5pbml0CisgKi8KKwordm9pZCBpeE5wZU1oQ29uZmlnVW5pbml0ICh2b2lkKQoreworICAgIEl4TnBlTWhOcGVJZCBucGVJZDsKKworICAgIElYX05QRU1IX1RSQUNFMCAoSVhfTlBFTUhfRk5fRU5UUllfRVhJVCwgIkVudGVyaW5nICIKKyAgICAgICAgICAgICAgICAgICAgICJpeE5wZU1oQ29uZmlnVW5pbml0XG4iKTsKKworICAgIC8qIGZvciBlYWNoIE5QRSAuLi4gKi8KKyAgICBmb3IgKG5wZUlkID0gMDsgbnBlSWQgPCBJWF9OUEVNSF9OVU1fTlBFUzsgbnBlSWQrKykKKyAgICB7CisgICAgICAgIC8qIGRlY2xhcmUgYSBjb252ZW5pZW5jZSBwb2ludGVyICovCisgICAgICAgIEl4TnBlTWhDb25maWdOcGVJbmZvICpucGVJbmZvID0gJml4TnBlTWhDb25maWdOcGVJbmZvW25wZUlkXTsKKyAgICAgICAgCisgICAgICAgIC8qIGRpc2Nvbm5lY3QgSVNSICovCisgICAgICAgIGl4T3NhbElycVVuYmluZChucGVJbmZvLT5pbnRlcnJ1cHRJZCk7CisKKyAgICAgICAgLyogZGVzdHJveSBtdXRleCBhc3NvY2lhdGVkIHdpdGggdGhpcyBOUEUgKi8KKyAgICAgICAgaXhPc2FsTXV0ZXhEZXN0cm95KCZucGVJbmZvLT5tdXRleCk7CisJCisJSVhfT1NBTF9NRU1fVU5NQVAgKG5wZUluZm8tPnZpcnR1YWxSZWdpc3RlckJhc2UpOworCisJbnBlSW5mby0+dmlydHVhbFJlZ2lzdGVyQmFzZSAgPSAwOworCW5wZUluZm8tPnN0YXR1c1JlZ2lzdGVyICA9IDA7CisJbnBlSW5mby0+Y29udHJvbFJlZ2lzdGVyID0gMDsKKwlucGVJbmZvLT5pbkZpZm9SZWdpc3RlciAgPSAwOworCW5wZUluZm8tPm91dEZpZm9SZWdpc3RlciA9IDA7CisgICAgfQorCisgICAgSVhfTlBFTUhfVFJBQ0UwIChJWF9OUEVNSF9GTl9FTlRSWV9FWElULCAiRXhpdGluZyAiCisgICAgICAgICAgICAgICAgICAgICAiaXhOcGVNaENvbmZpZ1VuaW5pdFxuIik7Cit9CisKKy8qCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeE5wZU1oQ29uZmlnSXNyUmVnaXN0ZXIKKyAqLworCit2b2lkIGl4TnBlTWhDb25maWdJc3JSZWdpc3RlciAoCisgICAgSXhOcGVNaE5wZUlkIG5wZUlkLAorICAgIEl4TnBlTWhDb25maWdJc3IgaXNyKQoreworICAgIElYX05QRU1IX1RSQUNFMCAoSVhfTlBFTUhfRk5fRU5UUllfRVhJVCwgIkVudGVyaW5nICIKKyAgICAgICAgICAgICAgICAgICA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ICZvZmUsIElYX05QRU1IX05QRV9DVExfT0ZFKTsKKworICAgIC8qIGlmIHRoZSBpbnRlcnJ1cHQgaXMgZGlzYWJsZWQgdGhlbiB3ZSBtdXN0IGVuYWJsZSBpdCAqLworICAgIGlmICghb2ZlKQorICAgIHsKKyAgICAgICAgLyogc2V0IHRoZSBPRkUgKE91dEZpZm9FbmFibGUpIGJpdCBvZiB0aGUgY29udHJvbCByZWdpc3RlciAqLworICAgICAgICAvKiB3ZSBtdXN0IHNldCB0aGUgT0ZFV0UgKE91dEZpZm9FbmFibGVXcml0ZUVuYWJsZSkgYXQgdGhlIHNhbWUgKi8KKyAgICAgICAgLyogdGltZSBmb3IgdGhlIHdyaXRlIHRvIGhhdmUgZWZmZWN0ICovCisgICAgICAgIElYX05QRU1IX1JFR0lTVEVSX1dSSVRFX0JJVFMgKGNvbnRyb2xSZWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChJWF9OUEVNSF9OUEVfQ1RMX09GRSB8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJWF9OUEVNSF9OUEVfQ1RMX09GRVdFKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKElYX05QRU1IX05QRV9DVExfT0ZFIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElYX05QRU1IX05QRV9DVExfT0ZFV0UpKTsKKyAgICB9CisKKyAgICAvKiByZXR1cm4gdGhlIHByZXZpb3VzIHN0YXRlIG9mIHRoZSBpbnRlcnJ1cHQgKi8KKyAgICByZXR1cm4gKG9mZSAhPSAwKTsKK30KKworLyoKKyAqIEZ1bmN0aW9uIGRlZmluaXRpb246IGl4TnBlTWhDb25maWdOcGVJbnRlcnJ1cHREaXNhYmxlCisgKi8KKworQk9PTCBpeE5wZU1oQ29uZmlnTnBlSW50ZXJydXB0RGlzYWJsZSAoCisgICAgSXhOcGVNaE5wZUlkIG5wZUlkKQoreworICAgIFVJTlQzMiBvZmU7CisgICAgdm9sYXRpbGUgVUlOVDMyICpjb250cm9sUmVnID0KKyAgICAgICAgKFVJTlQzMiAqKWl4TnBlTWhDb25maWdOcGVJbmZvW25wZUlkXS5jb250cm9sUmVnaXN0ZXI7CisKKyAgICAvKiBnZXQgdGhlIE9GRSAoT3V0Rmlmb0VuYWJsZSkgYml0IG9mIHRoZSBjb250cm9sIHJlZ2lzdGVyICovCisgICAgSVhfTlBFTUhfUkVHSVNURVJfUkVBRF9CSVRTIChjb250cm9sUmVnLCAmb2ZlLCBJWF9OUEVNSF9OUEVfQ1RMX09GRSk7CisKKyAgICAvKiBpZiB0aGUgaW50ZXJydXB0IGlzIGVuYWJsZWQgdGhlbiB3ZSBtdXN0IGRpc2FibGUgaXQgKi8KKyAgICBpZiAob2ZlKQorICAgIHsKKyAgICAgICAgLyogdW5zZXQgdGhlIE9GRSAoT3V0Rmlmb0VuYWJsZSkgYml0IG9mIHRoZSBjb250cm9sIHJlZ2lzdGVyICovCisgICAgICAgIC8qIHdlIG11c3Qgc2V0IHRoZSBPRkVXRSAoT3V0Rmlmb0VuYWJsZVdyaXRlRW5hYmxlKSBhdCB0aGUgc2FtZSAqLworICAgICAgICAvKiB0aW1lIGZvciB0aGUgd3JpdGUgdG8gaGF2ZSBlZmZlY3QgKi8KKyAgICAgICAgSVhfTlBFTUhfUkVHSVNURVJfV1JJVEVfQklUUyAoY29udHJvbFJlZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKDAgICAgICAgICAgICAgICAgICAgIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElYX05QRU1IX05QRV9DVExfT0ZFV0UpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoSVhfTlBFTUhfTlBFX0NUTF9PRkUgfAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVhfTlBFTUhfTlBFX0NUTF9PRkVXRSkpOworICAgI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5wZU1oQ29uZmlnU3RhdHNbbnBlSWRdLmluRmlmb1dyaXRlcysrOworICAgIAorICAgIHJldHVybiBJWF9TVUNDRVNTOworfQorCisvKgorICogRnVuY3Rpb24gZGVmaW5pdGlvbjogaXhOcGVNaENvbmZpZ091dEZpZm9SZWFkCisgKi8KKworSVhfU1RBVFVTIGl4TnBlTWhDb25maWdPdXRGaWZvUmVhZCAoCisgICAgSXhOcGVNaE5wZUlkIG5wZUlkLAorICAgIEl4TnBlTWhNZXNzYWdlICptZXNzYWdlKQoreworICAgIHZvbGF0aWxlIFVJTlQzMiAqbnBlT3V0RmlmbyA9CisgICAgICAgIChVSU5UMzIgKilpeE5wZU1oQ29uZmlnTnBlSW5mb1tucGVJZF0ub3V0Rmlmb1JlZ2lzdGVyOworICAgIFVJTlQzMiByZXRyaWVzQ291bnQgPSAwOworCisgICAgLyogcmVhZCB0aGUgZmlyc3Qgd29yZCBvZiB0aGUgbWVzc2FnZSBmcm9tIHRoZSBOUEUncyBvdXRGSUZPICovCisgICAgSVhfTlBFTUhfUkVHSVNURVJfUkVBRCAobnBlT3V0RmlmbywgJm1lc3NhZ2UtPmRhdGFbMF0pOworCisgICAgLyogbmVlZCB0byB3YWl0IGZvciBOUEUgdG8gd3JpdGUgc2Vjb25kIHdvcmQgLSBzZWUgU0NSICM0OTMgCisgICAgICAgcG9sbCBmb3IgbWF4aW11bSBudW1iZXIgb2YgcmV0cmllcywgaWYgZXhjZWVkIG1heGltdW0KKyAgICAgICByZXRyaWVzLCBleGl0IGZyb20gd2hpbGUgbG9vcCAqLworICAgIHdoaWxlICgoSVhfTlBFX01IX01BWF9OVU1fT0ZfUkVUUklFUyA+IHJldHJpZXNDb3VudCkKKyAgICAgICAgJiYgaXhOcGVNaENvbmZpZ091dEZpZm9Jc0VtcHR5IChucGVJZCkpCisgICAgeworICAgICAgICByZXRyaWVzQ291bnQrKzsKKyAgICB9CisKKyAgICAvKiBSZXR1cm4gVElNRU9VVCBzdGF0dXMgdG8gY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rOworICAgICAgICB9CisKKyAgICAgICAgLyogaWYgbm8gdW5zb2xpY2l0ZWQgY2FsbGJhY2sgd2FzIGZvdW5kIHRyeSB0byBmaW5kIGEgbWF0Y2hpbmcgKi8KKyAgICAgICAgLyogc29saWNpdGVkIGNhbGxiYWNrIGZvciB0aGlzIG1lc3NhZ2UgKi8KKyAgICAgICAgaWYgKGNhbGxiYWNrID09IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIGl4TnBlTWhTb2xpY2l0ZWRDYk1nckNhbGxiYWNrUmV0cmlldmUgKAorICAgICAgICAgICAgICAgIG5wZUlkLCBtZXNzYWdlSWQsICZjYWxsYmFjayk7CisKKyAgICAgICAgICAgIGlmIChjYWxsYmFjayAhPSBOVUxMKQorICAgICAgICAgICAgeworCQlJWF9OUEVNSF9UUkFDRTAgKElYX05QRU1IX0RFQlVHLAorCQkJCSAiRm91bmQgbWF0Y2hpbmcgc29saWNpdGVkIGNhbGxiYWNrXG4iKTsKKworICAgICAgICAgICAgICAgIC8qIHVwZGF0ZSBzdGF0aXN0aWNhbCBpbmZvICovCisgICAgICAgICAgICAgICAgaXhOcGVNaFJlY2VpdmVTdGF0c1tucGVJZF0uc29saWNpdGVkKys7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKiBpZiBhIGNhbGxiYWNrIChlaXRoZXIgdW5zb2xpY2l0ZWQgb3Igc29saWNpdGVkKSB3YXMgZm91bmQgKi8KKyAgICAgICAgaWYgKGNhbGxiYWNrICE9IE5VTEwpCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIGludm9rZSB0aGUgY2FsbGJhY2sgdG8gcGFzcyB0aGUgbWVzc2FnZSBiYWNrIHRvIHRoZSBjbGllbnQgKi8KKyAgICAgICAgICAgIGNhbGxiYWNrIChucGVJZCwgbWVzc2FnZSk7CisKKyAgICAgICAgICAgIC8qIHVwZGF0ZSBzdGF0aXN0aWNhbCBpbmZvICovCisgICAgICAgICAgICBpeE5wZU1oUm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ZGV4IDw9IElYX05QRU1IX01BWF9DQUxMQkFDS1M7IGxvY2FsSW5kZXgrKykKKyAgICAgICAgeworICAgICAgICAgICAgLyogaW5pdGlhbGlzZSB0aGUgZW50cnkgKi8KKyAgICAgICAgICAgIGxpc3QtPmVudHJpZXNbbG9jYWxJbmRleF0ubWVzc2FnZUlkID0gMHgwMDsKKyAgICAgICAgICAgIGxpc3QtPmVudHJpZXNbbG9jYWxJbmRleF0uY2FsbGJhY2sgPSBOVUxMOworCisgICAgICAgICAgICAvKiBpZiB0aGlzIGVudHJ5IGlzIGJlZm9yZSB0aGUgbGFzdCBlbnRyeSAqLworICAgICAgICAgICAgaWYgKGxvY2FsSW5kZXggPCBJWF9OUEVNSF9NQVhfQ0FMTEJBQ0tTKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIGNoYWluIHRoaXMgZW50cnkgdG8gdGhlIGZvbGxvd2luZyBlbnRyeSAqLworICAgICAgICAgICAgICAgIGxpc3QtPmVudHJpZXNbbG9jYWxJbmRleF0ubmV4dCA9ICYobGlzdC0+ZW50cmllc1tsb2NhbEluZGV4ICsgMV0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSAvKiB0aGlzIGVudHJ5IGlzIHRoZSBsYXN0IGVudHJ5ICovCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogdGhlIGxhc3QgZW50cnkgaXNuJ3QgY2hhaW5lZCB0byBhbnl0aGluZyAqLworICAgICAgICAgICAgICAgIGxpc3QtPmVudHJpZXNbbG9jYWxJbmRleF0ubmV4dCA9IE5VTEw7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvKiBzZXQgdGhlIGZyZWUgbGlzdCBwb2ludGVyIHRvIHBvaW50IHRvIHRoZSBmaXJzdCByZWFsIGVudHJ5ICovCisgICAgICAgIC8qIChhbGwgcmVhbCBlbnRyaWVzIGJlZ2luIGNoYWluZWQgdG9nZXRoZXIgb24gdGhlIGZyZWUgbGlzdC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QWxpZ25lZCwKKyAgICAgICAgICAgICAgICAgICAgICBJWF9PU0FMX01CVUZfUE9PTCAqcG9vbFB0cik7CisjZW5kaWYKKworUFJJVkFURSBJWF9PU0FMX01CVUZfUE9PTCAqIGl4T3NhbFBvb2xBbGxvYyAodm9pZCk7ICAgICAgICAgICAgICAgICAgICAgIAorCisvKgorICogRnVuY3Rpb24gZGVmaW5pdGlvbjogaXhPc2FsUG9vbEFsbG9jCisgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK1BSSVZBVEUgSVhfT1NBTF9NQlVGX1BPT0wgKgoraXhPc2FsUG9vbEFsbG9jICh2b2lkKQoreworICAgIHJlZ2lzdGVyIHVuc2lnbmVkIGludCBpID0gMDsKKworICAgIC8qCisgICAgICogU2NhbiBmb3IgdGhlIGZpcnN0IGZyZWUgYnVmZmVyLiBGcmVlIGJ1ZmZlcnMgYXJlIGluZGljYXRlZCBieSAwCisgICAgICogb24gdGhlIGNvcnJzcG9uZGluZyBiaXQgaW4gaXhPc2FsQnVmZkZyZWVQb29scy4gCisgICAgICovCisgICAgaWYgKGl4T3NhbEJ1ZmZQb29sc0luVXNlID49IElYX09TQUxfTUJVRl9NQVhfUE9PTFMpCisgICAgeworICAgICAgICAvKgorICAgICAgICAgKiBGYWlsIHRvIGdyYWIgYSBwdHIgdGhpcyB0aW1lIAorICAgICAgICAgKi8KKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisgICAgd2hpbGUgKGl4T3NhbEJ1ZmZGcmVlUG9vbHNbaSAvIElYX09TQUxfQlVGRl9GUkVFX0JJVFNdICYKKyAgICAgICAgKDEgPDwgKGkgJSBJWF9PU0FMX0JVRkZfRlJFRV9CSVRTKSkpCisgICAgICAgIGkrKzsKKyAgICAvKgorICAgICAqIEZyZWUgYnVmZmVyIGZvdW5kLiBNYXJrIGl0IGFzIGJ1c3kgYW5kIGluaXRpYWxpemUuIAorICAgICAqLworICAgIGl4T3NhbEJ1ZmZGcmV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KworUFVCTElDIElYX09TQUxfTUJVRl9QT09MICoKK2l4T3NhbFBvb2xJbml0IChVSU5UMzIgY291bnQsIFVJTlQzMiBzaXplLCBjb25zdCBjaGFyICpuYW1lKQoreworCisgICAgLyogVGhlc2UgdmFyaWFibGVzIGFyZSBvbmx5IHVzZWQgaWYgVVhfT1NBTF9CVUZGRVJfQUxMT0NfU0VQRVJBVEVMWQorICAgICAqIGlzIGRlZmluZWQgLgorICAgICAqLworI2lmZGVmIElYX09TQUxfQlVGRkVSX0FMTE9DX1NFUEFSQVRFTFkKKyAgICBVSU5UMzIgaSwgbWJ1ZlNpemVBbGlnbmVkLCBkYXRhU2l6ZUFsaWduZWQ7CisgICAgSVhfT1NBTF9NQlVGICpjdXJyZW50TWJ1ZlB0ciA9IE5VTEw7CisjZWxzZQorICAgIHZvaWQgKnBvb2xCdWZQdHI7CisgICAgdm9pZCAqcG9vbERhdGFQdHI7CisgICAgaW50IG1idWZNZW1TaXplOworICAgIGludCBkYXRhTWVtU2l6ZTsKKyNlbmRpZgorCisgICAgSVhfT1NBTF9NQlVGX1BPT0wgKnBvb2xQdHIgPSBOVUxMOworICAgIAorICAgIGlmIChjb3VudCA8PSAwKQorICAgIHsKKyAgICAgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfRVJST1IsCisgICAgICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RET1VULAorICAgICAgICAgICAgIml4T3NhbFBvb2xJbml0KCk6ICIgImNvdW50ID0gMCBcbiIsIDAsIDAsIDAsIDAsIDAsIDApOworICAgICAgICByZXR1cm4gTlVMTDsgICAgICAgIAorICAgIH0KKworICAgIGlmIChuYW1lID09IE5VTEwpCisgICAgeworICAgICAgICBpeE9zYWxMb2cgKElYX09TQUxfTE9HX0xWTF9FUlJPUiwKKyAgICAgICAgICAgIElYX09TQUxfTE9HX0RFVl9TVERPVVQsCisgICAgICAgICAgICAiaXhPc2FsUG9vbEluaXQoKTogIiAiTlVMTCBuYW1lIFxuI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HIgPSBOVUxMOworCisgICAgLyoKKyAgICAgKiBjaGVjayBwYXJhbWV0ZXJzIAorICAgICAqLworICAgIGlmIChwb29sQnVmUHRyID09IE5VTEwpCisgICAgeworICAgICAgICBpeE9zYWxMb2cgKElYX09TQUxfTE9HX0xWTF9FUlJPUiwKKyAgICAgICAgICAgIElYX09TQUxfTE9HX0RFVl9TVERPVVQsCisgICAgICAgICAgICAiaXhPc2FsTm9BbGxvY1Bvb2xJbml0KCk6ICIKKyAgICAgICAgICAgICJFUlJPUiAtIE5VTEwgcG9vbEJ1ZlB0ciBcbiIsIDAsIDAsIDAsIDAsIDAsIDApOworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgICBpZiAoY291bnQgPD0gMCkKKyAgICB7CisgICAgICAgIGl4T3NhbExvZyAoSVhfT1NBTF9MT0dfTFZMX0VSUk9SLAorICAgICAgICAgICAgSVhfT1NBTF9MT0dfREVWX1NURE9VVCwKKyAgICAgICAgICAgICJpeE9zYWxOb0FsbG9jUG9vbEluaXQoKTogIgorICAgICAgICAgICAgIkVSUk9SIC0gY291bnQgbXVzdCA+IDAgICBcbiIsIDAsIDAsIDAsIDAsIDAsIDApOworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgICBpZiAobmFtZSA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfRVJST1IsCisgICAgICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RET1VULAorICAgICAgICAgICAgIml4T3NhbE5vQWxsb2NQb29sSW5pdCgpOiAiCisgICAgICAgICAgICAiRVJST1IgLSBOVUxMIG5hbWUgcHRyICBcbiIsIDAsIDAsIDAsIDAsIDAsIDApOworICAgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgICBpZiAoc3RybGVuIChuYW1lKSA+IElYX09TQUxfTUJVRl9QT09MX05BTUVfTEVOKQorICAgIHsKKyAgICAgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfRVJST1IsCisgICAgICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RET1VULAorICAgICAgICAgICAgIml4T3NhbE5vQWxsb2NQb29sSW5pdCgpOiAiCisgICAgICAgICAgICAiRVJST1IgLSBuYW1lIGxlbmd0aCBzaG91bGQgYmUgbm8gZ3JlYXRlciB0aGFuICVkICBcbiIsCisgICAgICAgICAgICBJWF9PU0FMX01CVUZfUE9PTF9OQU1FX0xFTiwgMCwgMCwgMCwgMCwgMCk7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIHBvb2xQdHIgPSBpeE9zYWxQb29sQWxsb2MgKCk7CisKKyAgICBpZiAocG9vbFB0ciA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisgICAgLyoKKyAgICAgKiBBZGp1c3Qgc2l6ZXMgdG8gZW5zdXJlIGFsaWdubWVudCBvbiBjYWNoZSBsaW5lIGJvdW5kYXJpZXMgCisgICAgICovCisgICAgbWJ1ZlNpemVBbGlnbmVkID0KKyAgICAgICAgSVhfT1NBTF9NQlVGX1BPT0xfU0laRV9BTElHTiAoc2l6ZW9mIChJWF9PU0FMX01CVUYpKTsKKyAgICAvKgorICAgICAqIGNsZWFyIHRoZSBtYnVmIG1lbW9yeSBhcmVhIAorICAgICAqLworICAgIG1lbXNldCAocG9vbEJ1ZlB0ciwgMCwgbWJ1ZlNpemVBbGlnbmVkICogY291bnQpOworCisgICAgaWYgKHBvb2xEYXRhUHRyICE9IE5VTEwpCisgICAgeworICAgICAgICAvKgorICAgICAgICAgKiBBZGp1c3Qgc2l6ZXMgdG8gZW5zdXJlIGFsaWdubWVudCBvbiBjYWNoZSBsaW5lIGJvdW5kYXJpZXMgCisgICAgICAgICAqLworICAgICAgICBzaXplQWxpZ25lZCA9IElYX09TQUxfTUJVRl9QT09MX1NJWkVfQUxJR04gKHNpemUpOworICAgICAgICAvKgorICAgICAgICAgKiBjbGVhciB0aGUgZGF0YSBtZW1vcnkgYXJlYSAKKyAgICAgICAgICovCisgICAgICAgIG1lbXNldCAocG9vbERhdGFQdHIsIDAsIHNpemVBbGlnbmVkICogY291bnQpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBzaXplQWxpZ25lZCA9IDA7CisgICAgfQorCisgICAgLyoKKyAgICAgKiBpbml0aWFsaXNlIHBvb2wgZmllbGRzIAorICAgICAqLworICAgIHN0cmNweSAoKHBvb2xQdHIpLT5uYW1lLCBuYW1lKTsKKworICAgIHBvb2xQdHItPmRhdGFNZW1QdHIgPSBwb29sRGF0YVB0cjsKKyAgICBwb29sUHRyLT5tYnVmTWVtUHRyID0gcG9vbEJ1ZlB0cjsKKyAgICBwb29sUHRyLT5idWZEYXRhU2l6ZSA9IHNpemVBbGlnbmVkOworICAgIHBvb2xQdHItPnRvdGFsQnVmc0luUG9vbCA9IGNvdW50OworICAgIHBvb2xQdHItPm1idWZNZW1TaXplID0gbWJ1ZlNpemVBbGlnbmVkICogY291bnQ7CisgICAgcG9vbFB0ci0+ZGF0YU1lbVNpemUgPSBzaXplQWxpZ25lZCAqIGNvdW50OworCisgICAgY3VycmVudE1idWZQdHIgPSAoSVhfT1NBTF9NQlVGICopIHBvb2xCdWZQdHI7CisKKyAgICBwb29sUHRyLT5uZXh0RnJlZUJ1ZiA9IGN1cnJlbnRNYnVmUHRyOworCisgICAgZm9yIChpID0gMDsgaSA8IGNvdW50OyBpKyspCisgICAgeworICAgICAgICBpZiAoaSA8IChjb3VudCAtIDEpKQorICAgICAgICB7CisgICAgICAgICAgICBuZXh0TWJ1ZlB0ciA9CisgICAgICAgICAgICAgICAgKElYX09TQUxfTUJVRiAqKSAoKHVuc2lnbmVkKSBjdXJyZW50TWJ1ZlB0ciArCisgICAgICAgICAgICAgICAgbWJ1ZlNpemVBbGlnbmVkKTsKKyAgICAgICAgfQorICAgICAgICBlbHNlCisgICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgIC8qIGxhc3QgbWJ1ZiBpbiBjaGFpbiAqLworICAgICAgICAgICAgbmV4dE1idWZQdHIgPSBOVUxMOworICAgICAgICB9CisgICAgICAgIElYX09TQUxfTUJVRl9ORVhUX0JVRkZFUl9JTl9QS1RfUFRSIChjdXJyZW50TWJ1ZlB0cikgPSBuZXh0TWJ1ZlB0cjsKKyAgICAgICAgSVhfT1NBTF9NQlVGX05FVF9QT09MIChjdXJyZW50TWJ1ZlB0cikgPSBwb29sUHRyOworCisgICAgICAgIElYX09TQUxfTUJVRl9TWVNfU0lHTkFUVVJFX0lOSVQoY3VycmVudE1idWZQdHIpOworCisgICAgICAgIGlmIChwb29sRGF0YVB0ciAhPSBOVUxMKQorICAgICAgICB7CisgICAgICAgICAgICBJWF9PU0FMX01CVUZfTURBVEEgKGN1cnJlbnRNYnVmUHRyKSA9IHBvb2xEYXRhUHRyOworICAgICAgICAgICAgSVhfT1NBTF9NQlVGX0FMTE9DQVRFRF9CVUZGX0RBVEEoY3VycmVudE1idWZQdHIpID0gKFVJTlQzMikgcG9vbERhdGFQdHI7CisKKyAgICAgICAgICAgIElYX09TQUxfTUJVRl9NTEVOIChjdXJyZW50TWJ1ZlB0cikgPSBzaXplQWxpZ25lZDsKKyAgICAgICAgICAgIElYX09TQUxfTUJVRl9BTExPQ0FURURfQlVGRl9MRU4oY3VycmVudE1idWZQdHIpID0gc2l6ZUFsaWduZWQ7CisKKyAgICAgICAgICAgIHBvb2xEYXRhUHRyID0gKHZvaWQgKikgKCh1bnNpZ25lZCkgcG9vbERhdGFQdHIgKyBzaXplQWxpZ25lZCk7CisgICAgICAgIH0KKworICAgICAgICBjdXJyZW50TWJ1ZlB0ciA9IG5leHRNYnVmUHRyOworICAgIH0KKworICAgIC8qCisgICAgICogdXBkYXRlIHRoZSBudW1iZXIgb2YgZnJlZSBidWZmZXJzIGluIHRoZSBwb29sIAorICAgICAqLworICAgIHBvb2xQdHItPmZyZWVCdWZzSW5Qb29sID0gY291bnQ7CisKKyAgICBwb29sUHRyLT5wb29sQWxsb2NUeXBlID0gSVhfT1NBTF9NQlVGX1BPT0xfVFlQRV9VU0VSX0FMTE9DOworCisgICAgcmV0dXJuIHBvb2xQdHI7Cit9CisKKy8qIAorICogR2V0IGEgbWJ1ZiBwdHIgZnJvbSB0aGUgcG9vbAorICovCitQVUJMSUMgSVhfT1NBTF9NQlVGICoKK2l4T3NhbE1idWZBbGxvYyAoSVhfT1NBTF9NQlVGX1BPT0wgKiBwb29sUHRyKQoreworICAgIGludCBsb2NrOworICAgIElYX09TQUxfTUJVRiAqbmV3QnVmUHRyID0gTlVMTDsKKworICAgIC8qCisgICAgICogY2hlY2sgcGFyYW1ldGVycyAKKyAgICAgKi8KKyAgICBpZiAocG9vbFB0ciA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfRVJST1IsCisgICAgICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RET1VULAorICAgICAgICAgICAgIml4T3NhbE1idWZBbGxvYygpOiAiCisgICAgICAgICAgICAiRVJST1IgLSBJbnZhbGlkIFBhcmFtZXRlclxuIiwgMCwgMCwgMCwgMCwgMCwgMCk7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIGxvY2sgPSBpeE9zYWxJcnFMb2NrICgpOworCisgICAgbmV3QnVmUHRyID0gcG9vbFB0ci0+bmV4dEZyZWVCdWY7CisgICAgaWYgKG5ld0J1ZlB0cikKKyAgICB7CisgICAgICAgIHBvb2xQdHItPm5leHRGcmVlQnVmID0KKyAgICAgICAgICAgIElYX09TQUxfTUJVRl9ORVhUX0JVRkZFUl9JTl9QS1RfUFRSIChuZXdCdWZQdHIpOworICAgICAgICBJWF9PU0FMX01CVUZfTkVYVF9CVUZGRVJfSU5fUEtUX1BUUiAobmV3QnVmUHRyKSA9IE5VTEw7CisKKyAgICAgICAgLyoKKyAgICAgICAgICogdXBkYXRlIHRoZSBudW1iZXIgb2YgZnJlZSBidWZmZXJzIGluIHRoZSBwb29sIAorICAgICAgICAgKi8KKyAgICAgICAgcG9vbFB0ci0+ZnJlZUJ1ZnNJblBvb2wtLTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLyogUmV0dXJuIE5VTEwgdG8gaW5kaWNhdGUgdG8gY2FsbGVyIHRoYXQgcmVxdWVzdCBpcyBkZW5pZWQuICovCisgICAgICAgIGl4T3NhbElycVVubG9jayAobG9jayk7CisKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisjaWZkZWYgSVhfT1NBTF9CVUZGRVJfRlJFRV9QUk9URUNUSU9OCisJLyogU2V0IEJ1ZmZlciBVc2VkIEZsYWcgdG8gaW5kaWNhdGUgc3RhdGUuKi8KKyAgICBJWF9PU0FMX01CVUZfU0VUX1VTRURfRkxBRyhuZXdCdWZQdHIpOworI2VuZGlmCisKKyAgICBpeE9zYWxJcnFVbmxvY2sgKGxvY2spOworCisgICAgcmV0dXJuIG5ld0J1ZlB0cjsKK30KKworUFVCTElDIElYX09TQUxfTUJVRiAqCitpeE9zYWxNYnVmRnJlZSAoSVhfT1NBTF9NQlVGICogYnVmUHRyKQoreworICAgIGludCBsb2NrOworICAgIElYX09TQUxfTUJVRl9QT09MICpwb29sUHRyOworCisgICAgSVhfT1NBTF9NQlVGICpuZXh0QnVmUHRyID0gTlVMTDsKKworICAgIC8qCisgICAgICogY2hlY2sgcGFyYW1ldGVycyAKKyAgICAgKi8KKyAgICBpZiAoYnVmUHRyID09IE5VTEwpCisgICAgeworICAgICAgICBpeE9zYWxMb2cgKElYX09TQUxfTE9HX0xWTF9FUlJPUiwKKyAgICAgICAgICAgIElYX09TQUxfTE9HX0RFVl9TVERPVVQsCisgICAgICAgICAgICAiaXhPc2FsTWJ1ZkZyZWUoKTogIgorICAgICAgICAgICAgIkVSUk9SIC0gSW52YWxpZCBQYXJhbWV0ZXJcbiIsIDAsIDAsIDAsIDAsIDAsIDApOworICAgICAgICByZXR1cm4gTlVMT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nVmID0gYnVmUHRyOworCisgICAgLyoKKyAgICAgKiB1cGRhdGUgdGhlIG51bWJlciBvZiBmcmVlIGJ1ZmZlcnMgaW4gdGhlIHBvb2wgCisgICAgICovCisgICAgcG9vbFB0ci0+ZnJlZUJ1ZnNJblBvb2wrKzsKKworICAgIGl4T3NhbElycVVubG9jayAobG9jayk7CisKKyAgICByZXR1cm4gbmV4dEJ1ZlB0cjsKK30KKworUFVCTElDIHZvaWQKK2l4T3NhbE1idWZDaGFpbkZyZWUgKElYX09TQUxfTUJVRiAqIGJ1ZlB0cikKK3sKKyAgICB3aGlsZSAoKGJ1ZlB0ciA9IGl4T3NhbE1idWZGcmVlIChidWZQdHIpKSk7Cit9CisKKy8qCisgKiBGdW5jdGlvbiBkZWZpbml0aW9uOiBpeE9zYWxCdWZmUG9vbFNob3cKKyAqLworUFVCTElDIHZvaWQKK2l4T3NhbE1idWZQb29sU2hvdyAoSVhfT1NBTF9NQlVGX1BPT0wgKiBwb29sUHRyKQoreworICAgIElYX09TQUxfTUJVRiAqbmV4dEJ1ZlB0cjsKKyAgICBpbnQgY291bnQgPSAwOworICAgIGludCBsb2NrOworCisgICAgLyoKKyAgICAgKiBjaGVjayBwYXJhbWV0ZXJzIAorICAgICAqLworICAgIGlmIChwb29sUHRyID09IE5VTEwpCisgICAgeworICAgICAgICBpeE9zYWxMb2cgKElYX09TQUxfTE9HX0xWTF9FUlJPUiwKKyAgICAgICAgICAgIElYX09TQUxfTE9HX0RFVl9TVERPVVQsCisgICAgICAgICAgICAiaXhPc2FsQnVmZlBvb2xTaG93KCk6ICIKKyAgICAgICAgICAgICJFUlJPUiAtIEludmFsaWQgUGFyYW1ldGVyIiwgMCwgMCwgMCwgMCwgMCwgMCk7CisgICAgICAgIC8qCisgICAgICAgICAqIHJldHVybiBJWF9GQUlMOyAKKyAgICAgICAgICovCisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBsb2NrID0gaXhPc2FsSXJxTG9jayAoKTsKKyAgICBjb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yAoSVhfT1NBTF9MT0dfTFZMX01FU1NBR0UsCisgICAgICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RET1VULAorICAgICAgICAgICAgIk1idWYgTWVtIEFyZWEgU3RhcnQgYWRkcmVzczogJXBcbiIsCisgICAgICAgICAgICAodW5zaWduZWQgaW50KSBwb29sUHRyLT5tYnVmTWVtUHRyLCAwLCAwLCAwLCAwLCAwKTsKKyAgICAgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfTUVTU0FHRSwgSVhfT1NBTF9MT0dfREVWX1NURE9VVCwKKyAgICAgICAgICAgICJEYXRhIE1lbSBBcmVhIFN0YXJ0IGFkZHJlc3M6ICVwXG4iLAorICAgICAgICAgICAgKHVuc2lnbmVkIGludCkgcG9vbFB0ci0+ZGF0YU1lbVB0ciwgMCwgMCwgMCwgMCwgMCk7CisgICAgfQorfQorCitQVUJMSUMgdm9pZAoraXhPc2FsTWJ1ZkRhdGFQdHJSZXNldCAoSVhfT1NBTF9NQlVGICogYnVmUHRyKQoreworICAgIElYX09TQUxfTUJVRl9QT09MICpwb29sUHRyOworICAgIFVJTlQ4ICpwb29sRGF0YVB0cjsKKworICAgIGlmIChidWZQdHIgPT0gTlVMTCkKKyAgICB7CisgICAgICAgIGl4T3NhbExvZyAoSVhfT1NBTF9MT0dfTFZMX0VSUk9SLCBJWF9PU0FMX0xPR19ERVZfU1RET1VULAorICAgICAgICAgICAgIml4T3NhbEJ1ZmZQb29sQnVmRGF0YVB0clJlc2V0IgorICAgICAgICAgICAgIjogRVJST1IgLSBJbnZhbGlkIFBhcmFtZXRlclxuIiwgMCwgMCwgMCwgMCwgMCwgMCk7CisgICAgICAgIHJldHVybjsKKyAgICB9CisKKyAgICBwb29sUHRyID0gKElYX09TQUxfTUJVRl9QT09MICopIElYX09TQUxfTUJVRl9ORVRfUE9PTCAoYnVmUHRyKTsKKyAgICBwb29sRGF0YVB0ciA9IHBvb2xQdHItPmRhdGFNZW1QdHI7CisKKyAgICBpZiAocG9vbFB0ci0+cG9vbEFsbG9jVHlwZSA9PSBJWF9PU0FMX01CVUZfUE9PTF9UWVBFX1NZU19BTExPQykKKyAgICB7CisgICAgICAgIGlmIChJWF9PU0FMX01CVUZfR0VUX1NZU19TSUdOQVRVUkUoYnVmUHRyKSAhPSBJWF9PU0FMX01CVUZfU1lTX1NJR05BVFVSRSkKKyAgICAgICAgeworICAgICAgICAgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfRVJST1IsIElYX09TQUxfTE9HX0RFVl9TVERPVVQsCisgICAgICAgICAgICAgICAgIml4T3NhbEJ1ZmZQb29sQnVmRGF0YVB0clJlc2V0IgorICAgICAgICAgICAgICAgICI6IGludmFsaWQgbWJ1ZiwgY2Fubm90IHJlc2V0IG1EYXRhIHBvaW50ZXJcbiIsIDAsIDAsCisgICAgICAgICAgICAgICAgMCwgMCwgMCwgMCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgSVhfT1NBTF9NQlVGX01EQVRBIChidWZQdHIpID0gKFVJTlQ4KilJWF9PU0FMX01CVUZfQUxMT0NBVEVEX0JVRkZfREFUQSAoYnVmUHRyKTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgaWYgKHBvb2xEYXRhUHRyKQorICAgICAgICB7CisgICAgICAgICAgICB1bnNpZ25lZCBpbnQgYnVmU2l6ZSA9IHBvb2xQdHItPmJ1ZkRhdGFTaXplOworICAgICAgICAgICAgdW5zaWduZWQgaW50IGJ1ZkRhdGFBZGRyID0KKyAgICAgICAgICAgICAgICAodW5zaWduZWQgaW50KSBJWF9PU0FMX01CVUZfTURBVEEgKGJ1ZlB0cik7CisgICAgICAgICAgICB1bnNpZ25lZCBpbnQgcG9vbERhdGFBZGRyID0gKHVuc2lnbmVkIGludCkgcG9vbERhdGFQdHI7CisKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgKiB0aGUgcG9pbnRlciBpcyBzdGlsbCBwb2ludGluZyBzb21ld2hlcmUgaW4gdGhlIG1idWYgcGF5bG9hZC4KKyAgICAgICAgICAgICAqIFRoaXMgb3BlcmF0aW9uIG1vdmVzIHRoZSBwb2ludGVyIHRvIHRoZSBiZWdpbm5pbmcgb2YgdGhlIAorICAgICAgICAgICAgICogbWJ1ZiBwYXlsb2FkCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGJ1ZkRhdGFBZGRyID0gKChidWZEYXRhQWRkciAtIHBvb2xEYXRhQWRkcikgLyBidWZTaXplKSAqIGJ1ZlNpemU7CisgICAgICAgICAgICBJWF9PU0FMX01CVUZfTURBVEEgKGJ1ZlB0cikgPSAmcG9vbERhdGFQdHJbYnVmRGF0YUFkZHJdOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfV0FSTklORywgSVhfT1NBTF9MT0dfREVWX1NURE9VVCwKKyAgICAgICAgICAgICAgICAiaXhPc2FsQnVmZlBvb2xCdWZEYXRhUHRyUmVzZXQiCisgICAgICAgICAgICAgICAgIjogY2Fubm90IGJlIHVzZWQgaWYgdXNlciBzdXBwbGllZCBOVUxMIHBvaW50ZXIgZm9yIHBvb2wgZGF0YSBhcmVhICIKKyAgICAgICAgICAgICAgICAid2hlbiBwb29sIHdhcyBjcmVhdGVkXG4iLCAwLCAwLCAwLCAwLCAwLCAwKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorICAgIH0KKworfQorCisvKgorICogRnVuY3Rpb24gZGVmaW5pdGlvbjogaXhPc2FsQnVmZlBvb2xVbmluaXQKKyAqLworUFVCTElDIElYX1NUQVRVUworaXhPc2FsQnVmZlBvb2xVbmluaXQgKElYX09TQUxfTUJVRl9QT09MICogcG9vbCkKK3sKKyAgICBpZiAoIXBvb2wpCisgICAgeworICAgICAgICBpeE9zYWxMb2cgKElYX09TQUxfTE9HX0xWTF9FUlJPUiwgSVhfT1NBTF9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7CisKKyAgICBVSU5UMzIgbnVtTWFwRWxlbWVudHMgPQorICAgICAgICBzaXplb2YgKGl4T3NhbEdsb2JhbE1lbW9yeU1hcCkgLyBzaXplb2YgKEl4T3NhbE1lbW9yeU1hcCk7CisKKyAgICBmb3IgKG1hcEluZGV4ID0gMDsgbWFwSW5kZXggPCBudW1NYXBFbGVtZW50czsgbWFwSW5kZXgrKykKKyAgICB7CisgICAgICAgIEl4T3NhbE1lbW9yeU1hcCAqbWFwID0gJml4T3NhbEdsb2JhbE1lbW9yeU1hcFttYXBJbmRleF07CisKKyAgICAgICAgaWYgKHNlYXJjaENyaXRlcmlhID09IFNFQVJDSF9QSFlTSUNBTF9BRERSRVNTCisgICAgICAgICAgICAmJiByZXF1ZXN0ZWRBZGRyZXNzID49IG1hcC0+cGh5c2ljYWxBZGRyZXNzCisgICAgICAgICAgICAmJiAocmVxdWVzdGVkQWRkcmVzcyArIHNpemUpIDw9IChtYXAtPnBoeXNpY2FsQWRkcmVzcyArIG1hcC0+c2l6ZSkKKyAgICAgICAgICAgICYmIChtYXAtPm1hcEVuZGlhblR5cGUgJiByZXF1ZXN0ZWRFbmRpYW5UeXBlKSAhPSAwKQorICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gbWFwOworICAgICAgICB9CisgICAgICAgIGVsc2UgaWYgKHNlYXJjaENyaXRlcmlhID09IFNFQVJDSF9WSVJUVUFMX0FERFJFU1MKKyAgICAgICAgICAgICYmIHJlcXVlc3RlZEFkZHJlc3MgPj0gbWFwLT52aXJ0dWFsQWRkcmVzcworICAgICAgICAgICAgJiYgcmVxdWVzdGVkQWRkcmVzcyA8PSAobWFwLT52aXJ0dWFsQWRkcmVzcyArIG1hcC0+c2l6ZSkKKyAgICAgICAgICAgICYmIChtYXAtPm1hcEVuZGlhblR5cGUgJiByZXF1ZXN0ZWRFbmRpYW5UeXBlKSAhPSAwKQorICAgICAgICB7CisgICAgICAgICAgICByZXR1cm4gbWFwOworICAgICAgICB9CisgICAgICAg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TQUxfRFlOQU1JQ19NQVAgJiYgbWFwLT52aXJ0dWFsQWRkcmVzcyA9PSAwKQorICAgICAgICB7CisgICAgICAgICAgICBpZiAobWFwLT5tYXBGdW5jdGlvbiAhPSBOVUxMKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIG1hcC0+bWFwRnVuY3Rpb24gKG1hcCk7CisKKyAgICAgICAgICAgICAgICBpZiAobWFwLT52aXJ0dWFsQWRkcmVzcyA9PSAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICogZmFpbGVkIAorICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RERVJSLAorICAgICAgICAgICAgICAgICAgICAgICAgIk9TQUw6IFJlbWFwIGZhaWxlZCAtIFthZGRyIDB4JXg6c2l6ZSAweCV4OmVuZGlhblR5cGUgJWRdXG4iLAorICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdGVkQWRkcmVzcywgc2l6ZSwgcmVxdWVzdGVkRW5kaWFuVHlwZSwgMCwgMCwgMCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBOVUxMOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAqIGVycm9yLCBubyBtYXAgZnVuY3Rpb24gZm9yIGEgZHluYW1pYyBtYXAgCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgaXhPc2FsTG9nIChJWF9PU0FMX0xPR19MVkxfRkFUQUwsCisgICAgICAgICAgICAgICAgICAgIElYX09TQUxfTE9HX0RFVl9TVERFUlIsCisgICAgICAgICAgICAgICAgICAgICJPU0FMOiBObyBtYXAgZnVuY3Rpb24gZm9yIGEgZHluYW1pYyBtYXAgLSAiCisgICAgICAgICAgICAgICAgICAgICJbYWRkciAweCV4OnNpemUgMHgleDplbmRpYW5UeXBlICVkXVxuIiwKKyAgICAgICAgICAgICAgICAgICAgcmVxdWVzdGVkQWRkcmVzcywgc2l6ZSwgcmVxdWVzdGVkRW5kaWFuVHlwZSwgMCwgMCwgMCk7CisKKyAgICAgICAgICAgICAgICByZXR1cm4gTlVMTDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8qCisgICAgICAgICAqIGluY3JlbWVudCByZWZlcmVuY2UgY291bnQgCisgICAgICAgICAqLworICAgICAgICBtYXAtPnJlZkNvdW50Kys7CisKKyAgICAgICAgcmV0dXJuICh2b2lkICopIChtYXAtPnZpcnR1YWxBZGRyZXNzICsgb2Zmc2V0KTsKKyAgICB9CisKKyAgICAvKgorICAgICAqIHJlcXVlc3RlZCBhZGRyZXNzIGlzIG5vdCBkZXNjcmliZWQgaW4gdGhlIGdsb2JhbCBtZW1vcnkgbWFwIAorICAgICAqLworICAgIGl4T3NhbExvZyAoSVhfT1NBTF9MT0dfTFZMX0ZBVEFMLAorICAgICAgICBJWF9PU0FMX0xPR19ERVZfU1RERVJSLAorICAgICAgICAiT1NBTDogTm8gbWFwcGluZyBmb3VuZCAtIFthZGRyIDB4JXg6c2l6ZSAweCV4OmVuZGlhblR5cGUgJWRdXG4iLAorICAgICAgICByZXF1ZXN0ZWRBZGRyZXNzLCBzaXplLCByZXF1ZXN0ZWRFbmRpYW5UeXBlLCAwLCAwLCAwKTsKKyAgICByZXR1cm4gTlVMTDsKK30KKworLyoKKyAqIFRoaXMgZnVuY3Rpb24gdW5tYXBzIGEgcHJldmlvdXNseSBtYXBwZWQgSS9PIG1lbW9yeSB6b25lIHVzaW5nCisgKiB0aGUgY29va2llIG9idGFpbmVkIGluIHRoZSBtYXBwaW5nIG9wZXJhdGlvbi4gVGhlIG1lb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CisgICAgICAgIGl4T3NhbE1lbU1hcEZpbmQgKHJlcXVlc3RlZEFkZHJlc3MsIDAsIFNFQVJDSF9WSVJUVUFMX0FERFJFU1MsCisgICAgICAgIGVuZGlhblR5cGUpOworCisgICAgaWYgKG1hcCAhPSBOVUxMKQorICAgIHsKKyAgICAgICAgaWYgKG1hcC0+cmVmQ291bnQgPiAwKQorICAgICAgICB7CisgICAgICAgICAgICAvKgorICAgICAgICAgICAgICogZGVjcmVtZW50IHJlZmVyZW5jZSBjb3VudCAKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgbWFwLT5yZWZDb3VudC0tOworCisgICAgICAgICAgICBpZiAobWFwLT5yZWZDb3VudCA9PSAwKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICogbm8gbG9uZ2VyIHVzZWQsIGRlYWxsb2NhdGUgCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgaWYgKG1hcC0+dHlwZSA9PSBJWF9PU0FMX0RZTkFNSUNfTUFQCisgICAgICAgICAgICAgICAgICAgICYmIG1hcC0+dW5tYXBGdW5jdGlvbiAhPSBOVUxMKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgbWFwLT51bm1hcEZ1bmN0aW9uIChtYXApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBpeE9zYWxMb2cgKElYX09TQUxfTE9HX0xWTF9XQVJOSU5HLAorICAgICAgICAgICAgSVhfT1NBTF9MT0dfREVWX1NUREVSUiwKKyAgICAgICAgICAgICJPU0FMOiBpeE9zU2Vydk1lbVVubWFwIGRpZG4ndCBmaW5kIHRoZSByZXF1ZXN0ZWQgbWFwICIKKyAgICAgICAgICAgICJbdmlydCBhZGRyIDB4JXg6IGVuZGlhblR5cGUgJWRdLCBpZ25vcmluZyBjYWxsXG4iLAorICAgICAgICAgIC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ZXMgJ2Z1bGwnLgorICovCitQVUJMSUMgSVhfU1RBVFVTCitpeE9zYWxTZW1hcGhvcmVQb3N0IChJeE9zYWxTZW1hcGhvcmUgKiBzaWQpCit7CisgICAgZGlhZ19wcmludGYoIiVzIGNhbGxlZFxuIiwgX19GVU5DVElPTl9fKTsKKyAgICByZXR1cm4gSVhfU1VDQ0VTUzsKK30KKworUFVCTElDIElYX1NUQVRVUworaXhPc2FsU2VtYXBob3JlR2V0VmFsdWUgKEl4T3NhbFNlbWFwaG9yZSAqIHNpZCwgVUlOVDMyICogdmFsdWUpCit7CisgICAgZGlhZ19wcmludGYoIiVzIGNhbGxlZFxuIiwgX19GVU5DVElPTl9fKTsKKyAgICByZXR1cm4gSVhfRkFJTDsKK30KKworUFVCTElDIElYX1NUQVRVUworaXhPc2FsU2VtYXBob3JlRGVzdHJveSAoSXhPc2FsU2VtYXBob3JlICogc2lkKQoreworICAgIGRpYWdfcHJpbnRmKCIlcyBjYWxsZWRcbiIsIF9fRlVOQ1RJT05fXyk7CisgICAgcmV0dXJuIElYX0ZBSUw7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgICBNdXRleAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKK3N0YXRpYyB2b2lkIGRydl9tdXRleF9pbml0KEl4T3NhbE11dGV4ICptdXRleCkKK3sKKwkqbXV0ZXggPSAwOworfQorCitzdGF0aWMgdm9pZCBkcnZfbXV0ZXhfZGVzdHJveShJeE9zYWxNdXRleCAqbXV0ZXgpCit7CisJKm11dGV4ID0gLTE7Cit9CisKK3N0YXRpYyBpbnQgZHJ2X211dGV4X3RyeWxvY2soSXhPc2FsTXV0ZXggKm11dGV4KQoreworCWludCByZXN1bHQgPSBUUlVFOworCisJaWYgKCptdXRleCA9PSAxKQorCQlyZXN1bHQgPSBGQUxTRTsKKworCXJldHVybiByZXN1bHQ7Cit9CisKK3N0YXRpYyB2b2lkIGRydl9tdXRleF91bmxvY2soSXhPc2FsTXV0ZXggKm11dGV4KQoreworCWlmICgqbXV0ZXggPT0gMSkKKwkJcHJpbnRmKCJUcnlpbmcgdG8gdW5sb2NrIHVubG9ja2VkIG11dGV4ISIpOworCisJKm11dGV4ID0gMDsKK30KKworUFVCTElDIElYX1NUQVRVUworaXhPc2FsTXV0ZXhJbml0IChJeE9zYWxNdXRleCAqIG11dGV4KQoreworICAgIGRydl9tdXRleF9pbml0KG11dGV4KTsKKyAgICByZXR1cm4gSVhfU1VDQ0VTUzsKK30KKworUFVCTElDIElYX1NUQVRVUworaXhPc2FsTXV0ZXhMb2NrIChJeE9zYWxNdXRleCAqIG11dGV4LCBJTlQzMiB0aW1lb3V0KQoreworICAgIGludCB0cmllczsKKworICAgIGlmICh0aW1lb3V0ID09IElYX09TQUxfV0FJVF9OT05FKSB7CisJaWYgKGRydl9tdXRleF90cnlsb2NrKG11dGV4KSkKKwkgICAgcmV0dXJuIElYX1NVQ0NFU1M7CisJZWxzZQorCSAgICByZXR1cm4gSVhfRkFJTDsKKyAgICB9CisKKyAgICB0cmllcyA9ICh0aW1lb3V0ICogMTAwMCkgLyA1MDsKKyAgICB3aGlsZSAoMSkgeworCWlmIChkcnZfbXV0ZXhfdHJ5bG9jayhtdXRleCkpCisJICAgIHJldHVybiBJWF9TVUNDRVNTOworCWlmICh0aW1lb3V0ICE9IElYX09TQUxfV0FJVF9GT1JFVkVSICYmIHRyaWVzLS0gPD0gMCkKKwkgICAgYnJlYWs7CisJdWRlbGF5KDUwKTsKKyAgICB9CisgICAgcmV0dXJuIElYX0ZBSUw7Cit9CisKK1BVQkxJQyBJWF9TVEFUVVMKK2l4T3NhbE11dGV4VW5sb2NrIChJeE9zYWxNdXRleCAqIG11dGV4KQoreworICAgIGRydl9tdXRleF91bmxvY2sobXV0ZXgpOworICAgIHJldHVybiBJWF9TVUNDRVNTOworfQorCisvKgorICogQXR0ZW1wdCB0byBnZXQgbXV0ZXgsIHJldHVybiBpbW1lZGlhdGVseSwKKyAqIG5v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WwgPSBJWF9PU0FMX0xPR19MVkxfTUVTU0FHRTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBJcnEgc2VydmljZXMKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCitQVUJMSUMgSVhfU1RBVFVTCitpeE9zYWxJcnFCaW5kIChVSU5UMzIgdmVjdG9yLCBJeE9zYWxWb2lkRm5Wb2lkUHRyIHJvdXRpbmUsIHZvaWQgKnBhcmFtZXRlcikKK3sKKyAgICByZXR1cm4gSVhfRkFJTDsKK30KKworUFVCTElDIElYX1NUQVRVUworaXhPc2FsSXJxVW5iaW5kIChVSU5UMzIgdmVjdG9yKQoreworICAgIHJldHVybiBJWF9GQUlMOworfQorCitQVUJMSUMgVUlOVDMyCitpeE9zYWxJcnFMb2NrICgpCit7CisgICAgcmV0dXJuIDA7Cit9CisKKy8qIEVuYWJsZSBpbnRlcnJ1cHRzIGFuZCB0YXNrIHNjaGVkdWxpbmcsCisgKiBpbnB1dCBwYXJhbWV0ZXI6IGlycUVuYWJsZSBzdGF0dXMgcmV0dXJuZWQKKyAqIGJ5IGl4T3NhbElycUxvY2soKS4KKyAqLworUFVCTElDIHZvaWQKK2l4T3NhbElycVVubG9jayAoVUlOVDMyIGxvY2tLZXkpCit7Cit9CisKK1BVQkxJQyBVSU5UMzIKK2l4T3NhbElycUxldmVsU2V0IChVSU5UMzIgbGV2ZWwpCit7CisgICAgcmV0dXJuIElYX0ZBSUw7Cit9CisKK1BVQkxJQyB2b2lkCitpeE9zYWxJcnFFbmFibGUgKFVJTlQzMiBpcnFMZXZlbCkKK3sKK30KKworUFVCTElDIHZvaWQKK2l4T3NhbElycURpc2FibGUgKFVJTlQzMiBpcnFMZXZlbCkKK3sKK30KKworLyoqKioqKioqKioqKioqKioqKioqKgorICogTG9nIGZ1bmN0aW9uCisgKioqKioqKioqKioqKioqKioqKioqLworCitJTlQzMgoraXhPc2FsTG9nIChJeE9zYWxMb2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MVkxfVVNFUikgPyAwIDogc3RybGVuKHRyYWNlSGVhZGVyc1tsZXZlbCAtIDFdKTsKKworICAgICAgICByZXR1cm4gaGVhZGVyQnl0ZUNvdW50ICsgc3RybGVuKGZvcm1hdCk7CisjZW5kaWYKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICAgICAgLyoKKyAgICAgICAgICogUmV0dXJuIGVycm9yCisgICAgICAgICAqLworICAgICAgICByZXR1cm4gKElYX09TQUxfTE9HX0VSUk9SKTsKKyAgICB9Cit9CisKK1BVQkxJQyBVSU5UMzIKK2l4T3NhbExvZ0xldmVsU2V0IChVSU5UMzIgbGV2ZWwpCit7CisgICAgVUlOVDMyIG9sZExldmVsOworCisgICAgLyoKKyAgICAgKiBDaGVjayB2YWx1ZSBmaXJzdAorICAgICAqLworICAgIGlmICgobGV2ZWwgPCBJWF9PU0FMX0xPR19MVkxfTk9ORSkgfHwgKGxldmVsID4gSVhfT1NBTF9MT0dfTFZMX0FMTCkpCisgICAgeworICAgICAgICBpeE9zYWxMb2cgKElYX09TQUxfTE9HX0xWTF9NRVNTQUdFLAorICAgICAgICAgICAgSVhfT1NBTF9MT0dfREVWX1NURE9VVCwKKyAgICAgICAgICAgICJpeE9zYWxMb2dMZXZlbFNldDogTG9nIExldmVsIGlzIGJldHdlZW4gJWQgYW5kJWQgXG4iLAorICAgICAgICAgICAgSVhfT1NBTF9MT0dfTFZMX05PTkUsIElYX09TQUxfTE9HX0xWTF9BTEwsIDAsIDAsIDAsIDApOworICAgICAgICByZXR1cm4gSVhfT1NBTF9MT0dfTFZMX05PTkU7CisgICAgfQorICAgIG9sZExldmVsID0gaXhPc2FsQ3VyckxvZ0xldmVsOworCisgICAgaXhPc2FsQ3VyckxvZ0xldmVsID0gbGV2ZWw7CisKKyAgICByZXR1cm4gb2xkTGV2ZWw7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogVGFzayBzZXJ2aWNlcworICoqKioqKioqKioqK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FX09GRlNFVCAgICAgICAweDE2CisjZGVmaW5lIElYX1FNR1JfUV9DT05GSUdfQlNJWkVfT0ZGU0VUICAgICAgIDB4MTgKKyNkZWZpbmUgSVhfUU1HUl9RX0NPTkZJR19ORV9PRkZTRVQgICAgICAgICAgMHgxQQorI2RlZmluZSBJWF9RTUdSX1FfQ09ORklHX05GX09GRlNFVCAgICAgICAgICAweDFECisKKyNkZWZpbmUgSVhfUU1HUl9CQVNFX0FERFJfMTZfV09SRF9BTElHTiAgICAgMHg0MAorI2RlZmluZSBJWF9RTUdSX0JBU0VfQUREUl8xNl9XT1JEX1NISUZUICAgICAweDYKKworI2RlZmluZSBJWF9RTUdSX05FX05GX0NMRUFSX01BU0sgICAgICAgICAgICAweDAzRkZGRkZGCisjZGVmaW5lIElYX1FNR1JfTkVfTUFTSyAgICAgICAgICAgICAgICAgICAgIDB4NworI2RlZmluZSBJWF9RTUdSX05GX01BU0sgICAgICAgICAgICAgICAgICAgICAweDcKKyNkZWZpbmUgSVhfUU1HUl9TSVpFX01BU0sgICAgICAgICAgICAgICAgICAgMHgzCisjZGVmaW5lIElYX1FNR1JfRU5UUllfU0laRV9NQVNLICAgICAgICAgICAgIDB4MworI2RlZmluZSBJWF9RTUdSX0JBRERSX01BU0sgICAgICAgICAgICAgICAgICAweDAwM0ZDMDAwCisjZGVmaW5lIElYX1FNR1JfUkRQVFJfTUFTSyAgICAgICAgICAgICAgICAgIDB4N0YKKyNkZWZpbmUgSVhfUU1HUl9XUlBUUl9NQVNLICAgICAgICAgICAgICAgICAgMHg3RgorI2RlZmluZSBJWF9RTUdSX1JEV1JQVFJfTUFTSyAgICAgICAgICAgICAgICAweDAwMDAzRkZGCisKKyNkZWZpbmUgSVhfUU1HUl9BUU1fQUREUkVTU19TUEFDRV9TSVpFX0lOX1dPUkRTIDB4MTAwMAorCisvKiBCYXNlIGFkZHJlc3Mgb2YgQVFNIFNSQU0gKi8KKyNkZWZpbmUgSVhfUU1HUl9BUU1fU1JBTV9C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gorICogSW5mb3JtYXRpb24gb24gYSBxdWV1ZSBuZWVkZWQgYnkgdGhlIERpc3BhdGNoZXIKKyAqLwordHlwZWRlZiBzdHJ1Y3QgCit7CisgICAgSXhRTWdyQ2FsbGJhY2sgY2FsbGJhY2s7ICAgICAgIC8qIE5vdGlmaWNhdGlvbiBjYWxsYmFjayAgICAgICAgICAgICAgICAgICovCisgICAgSXhRTWdyQ2FsbGJhY2tJZCBjYWxsYmFja0lkOyAgIC8qIE5vdGlmaWNhdGlvbiBjYWxsYmFjayBpZGVudGlmaWVyICAgICAgICovCisgICAgdW5zaWduZWQgZHVtbXlDYWxsYmFja0NvdW50OyAgIC8qIE51bWJlciBvZiB0aW1lcyBydW5zIG9mIGR1bW15IGNhbGxiYWNrICovCisgICAgSXhRTWdyUHJpb3JpdHkgcHJpb3JpdHk7ICAgICAgIC8qIERpc3BhdGNoIHByaW9yaXR5ICAgICAgICAgICAgICAgICAgICAgICovCisgICAgdW5zaWduZWQgaW50IHN0YXR1c1dvcmRPZmZzZXQ7IC8qIE9mZnNldCB0byB0aGUgc3RhdHVzIHdvcmQgdG8gY2hlY2sgICAgICovCisgICAgVUlOVDMyIHN0YXR1c01hc2s7ICAgICAgICAgICAgIC8qIFN0YXR1cyBtYXNrICAgICAgICAgICAgICAgICAgICAgICAgICAgICovICAgIAorICAgIFVJTlQzMiBzdGF0dXNDaGVja1ZhbHVlOyAgICAgICAvKiBTdGF0dXMgY2hlY2sgdmFsdWUgICAgICAgICAgICAgICAgICAgICAqLworICAgIFVJTlQzMiBpbnRSZWdDaGVja01hc2s7CSAgIC8qIEludGVycnVwdCByZWdpc3RlciBjaGVjayBtYXNrICAgICAgICAgICovCit9IEl4UU1nclFJbmZvOworCisvKgorICogVmFyaWFibGUgZGVjbGFyYXRpb25zIGdsb2JhbCB0byB0aGlzIGZpbGUuIEV4dGVybnMgYXJlIGZvbGxvd2VkIGJ5CisgKiBzdGF0aWNzLgorICovCisKKy8qIAorICogRmxhZyB0byBrZW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GZvciB0aGUgdW5kZXJseWluZyBzaWxpY29uICovCisgICAgcHJvZHVjdElkID0gaXhGZWF0dXJlQ3RybFByb2R1Y3RJZFJlYWQoKTsKKworICAgIC8qIAorICAgICAqIENoZWNrIGZlYXR1cmVDdHJsIHRvIHNlZSBpZiBMaXZlbG9jayBwcmV2ZW50aW9uIGlzIHJlcXVpcmVkIAorICAgICAqLworICAgIGl4UU1nck9yaWdCMERpc3BhdGNoZXIgPSBpeEZlYXR1cmVDdHJsU3dDb25maWd1cmF0aW9uQ2hlY2soIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVhfRkVBVFVSRUNUUkxfT1JJR0IwX0RJU1BBVENIRVIpOworCisgICAgLyoKKyAgICAgKiBDaGVjayBpZiB0aGUgc2lsaWNvbiBzdXBwb3J0cyB0aGUgc3RpY2t5IGludGVycnVwdCBmZWF0dXJlLgorICAgICAqIElGIChJWFA0MlggQU5EIEEwKSAtPiBObyBzdGlja3kgaW50ZXJydXB0IGZlYXR1cmUgc3VwcG9ydGVkIAorICAgICAqLworICAgIGlmICgoSVhfRkVBVFVSRV9DVFJMX0RFVklDRV9UWVBFX0lYUDQyWCA9PSAKKyAgICAgICAgKElYX0ZFQVRVUkVfQ1RSTF9ERVZJQ0VfVFlQRV9NQVNLICYgZGV2aWNlSWQpKSAmJgorICAgICAgICAoSVhfRkVBVFVSRV9DVFJMX1NJTElDT05fVFlQRV9BMCA9PSAKKyAgICAgICAgKElYX0ZFQVRVUkVfQ1RSTF9TSUxJQ09OX1NURVBQSU5HX01BU0sgJiBwcm9kdWN0SWQpKSkgCisgICAgeworICAgICAgIHN0aWNreUludFNpbGljb24gPSBGQUxTRTsKKyAgICB9CisKKyAgICAvKgorICAgICAqIElGIHVzZXIgd2FudHMgbGl2ZWxvY2sgcHJldiBvcHRpb24gQU5EIHNpbGljb24gc3VwcG9ydHMgc3RpY2t5IGludGVycnVwdCAKKyAgICAgKiBmZWF0dXJlIC0+IGVuYWJsZSB0aGUg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X01JTl9RVUVVUFBfUUlEOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvKiBjaGVjayBpZiB0aGUgaW50ZXJydXB0IHJlZ2lzdGVyIGNvbnRhaW5zCisgICAgICAgICAgICAgKiBvbmx5IDEgYml0IHNldAorICAgICAgICAgICAgICogRm9yIGV4YW1wbGU6CisgICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRSZWdWYWwgPSAweDAwMTAKKyAgICAgICAgICAgICAqICAgICAgICAgICAgICAgY3VyckRpc3BhdGNoUUluZm8tPmludFJlZ0NoZWNrTWFzayA9IDB4MDAxMAorICAgICAgICAgICAgICogICAgaW50UmVnVmFsID09IGN1cnJEaXNwYXRjaFFJbmZvLT5pbnRSZWdDaGVja01hc2sgaXMgVFJVRS4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgIGN1cnJEaXNwYXRjaFFJbmZvID0gJmRpc3BhdGNoUUluZm9bcUluZGV4XTsKKyAgICAgICAgICAgICBpZiAoaW50UmVnVmFsID09IGN1cnJEaXNwYXRjaFFJbmZvLT5pbnRSZWdDaGVja01hc2spCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIG9ubHkgMSBxdWV1ZSBldmVudCB0cmlnZ2VyZWQgYSBub3RpZmljYXRpb24gKgorICAgICAgICAgICAgICAgICAqIENhbGwgdGhlIGNhbGxiYWNrIGZ1bmN0aW9uIGZvciB0aGlzIHF1ZXVlCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgY3VyckRpc3BhdGNoUUluZm8tPmNhbGxiYWNrIChxSW5kZXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VyckRpc3BhdGNoUUluZm8tPmNhbGxiYWNrSWQpOworI2lmbmRlZiBOREVCVUcKKyAgICAgICAgICAgICAgICAvKiBVcGRhdGUgc3RhdGlzdGljcyAqLworICAgICAgICAgICAgICAgIGRpc3BhdGNoZXJTdGF0cy5xdWV1ZVN0YXRzW3FJbmRleF0uY2FsbGJhY2tDbnQrKzsKKyNlbmRpZgorICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAvKiB0aGUgZXZlbnQgaXMgdHJpZ2dlcmVkIGJ5IG1vcmUgdGhhbiAxIHF1ZXVlLAorICAgICAgICAgICAgICAgICAgKiB0aGUgcXVldWUgc2VhcmNoIHdpbGwgYmUgc3RhcnRpbmcgZnJvbSB0aGUgYmVnaW5uaW5nCisgICAgICAgICAgICAgICAgICAqIG9yIHRoZSBtaWRkbGUgb2YgdGhlIHByaW9yaXR5IHRhYmxlCisgICAgICAgICAgICAgICAgICAqCisgICAgICAgICAgICAgICAgICAqIHRoZSBzZXJhY2ggd2lsbCBlbmQgd2hlbiBhbGwgdGhlIGJpdHMgb2YgdGhlIGludGVycnVwdAorICAgICAgICAgICAgICAgICAgKiByZWdpc3RlciBhcmUgY2xlYXJlZC4gVGhlcmUgaXMgbm8gbmVlZCB0byBtYWludGFpbgorICAgICAgICAgICAgICAgICAgKiBhIHNlcGVyYXRlIHZhbHVlIGFuZCB0ZXN0IGl0IGF0IGVhY2ggaXRlcmF0aW9uLgorICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgaWYgKElYX1FNR1JfUVVFTE9XX0dST1VQID09IGdyb3VwKQorICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAvKiBjaGVjayBpZiBhbnkgYml0IHJlbGF0ZWQgdG8gcXVldWVzIGluIHRoZSBmaXJzdAorICAgICAgICAgICAgICAgICAgICAgICogaGFsZiBvZiB0aGUgcHJpb3JpdHkgdGFibGUgaXMgc2V0CisgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgIGlmIChpbnRSZWdWYWwgJiBsb3dQcmlvcml0eVRhYmxlRmlyc3RIYWxmTWFzaykKKyAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICBwcmlvcml0eVRhYmxlSW5kZXggPSBJWF9RTUdSX01JTl9MT1dfUVVFX1BSSU9SSVRZX1RBQkxFX0lOREVYOworICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIHByaW9yaXR5VGFibGVJbmRleCA9IElYX1FNR1JfTUlEX0xPV19RVUVfUFJJT1JJVFlfVEFCTEVfSU5ERVg7CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgIC8qIGNoZWNrIGlmIGFueSBiaXQgcmVsYXRlZCB0byBxdWV1ZXMgaW4gdGhlIGZpcnN0CisgICAgICAgICAgICAgICAgICAgICAgKiBoYWxmIG9mIHRoZSBwcmlvcml0eSB0YWJsZSBpcyBzZXQKKyAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgaWYgKGludFJlZ1ZhbCAmIHVwcFByaW9yaXR5VGFibGVGaXJzdEhhbGZNYXNrKQorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIHByaW9yaXR5VGFibGVJbmRleCA9IElYX1FNR1JfTUlOX1VQUF9RVUVfUFJJT1JJVFlfVEFCTEVfSU5ERVg7CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgcHJpb3JpdHlUYWJsZUluZGV4ID0gSVhfUU1HUl9NSURfVVBQX1FVRV9QUklPUklUWV9UQUJMRV9JTkRFWDsKKyAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgIC8qIGl0ZXJhdGUgZm9sbG93aW5nIHRoZSBwcmlvcml0eSB0YWJsZSB1bnRpbCBhbGwgdGhlIGJpdHMKKyAgICAgICAgICAgICAgICAgICogb2YgdGhlIGludGVycnVwdCByZWdpc3RlciBhcmUgY2xlYXJlZC4KKyAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgIGRvCisgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgIHFJbmRleCA9IHByaW9yaXR5VGFibGVbcHJpb3JpdHlUYWJsZUluZGV4KytdOworICAgICAgICAgICAgICAgICAgICAgY3VyckRpc3BhdGNoUUluZm8gPSAmZGlzcGF0Y2hRSW5mb1txSW5kZXhdOworICAgICAgICAgICAgICAgICAgICAgaW50UmVnQ2hlY2tNYXNrID0gY3VyckRpc3BhdGNoUUluZm8tPmludFJlZ0NoZWNrTWFzazsKKworICAgICAgICAgICAgICAgICAgICAgLyogSWYgdGhpcyBxdWV1ZSBjYXVzZWQgdGhpcyBpbnRlcnJ1cHQgdG8gYmUgcmFpc2VkICovCisgICAgICAgICAgICAgICAgICAgICBpZiAoaW50UmVnVmFsICYgaW50UmVnQ2hlY2tNYXNrKQorICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENhbGwgdGhlIGNhbGxiYWNrIGZ1bmN0aW9uIGZvciB0aGlzIHF1ZXVlICovCisgICAgICAgICAgICAgICAgICAgICAgICAgY3VyckRpc3BhdGNoUUluZm8tPmNhbGxiYWNrIChxSW5kZXgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VyckRpc3BhdGNoUUluZm8tPmNhbGxiYWNrSWQpOworI2lmbmRlZiBOREVCVUcKKyAgICAgICAgICAgICAgICAgICAgICAgICAvKiBVcGRhdGUgc3RhdGlzdGljcyAqLworICAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BhdGNoZXJTdGF0cy5xdWV1ZVN0YXRzW3FJbmRleF0uY2FsbGJhY2tDbnQrKzsKKyNlbmRpZgorCisgICAgICAgICAgICAgICAgICAgICAgICAgLyogQ2xlYXIgdGhlIGludGVycnVwdCByZWdpc3RlciBiaXQgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICBpbnRSZWdWYWwgJj0gfmludFJlZ0NoZWNrTWFzazsKKyAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHdoaWxlKGludFJlZ1ZhbCk7CisgICAgICAgICAgICAgfSAvKkVuZCBvZiBpbnRSZWdWYWwgPT0gY3VyckRpc3BhdGNoUUluZm8tPmludFJlZ0NoZWNrTWFzayAqLworICAgICB9IC8qIEVuZCBvZiBpbnRSZWdWYWwgIT0gMCAqLworCisjaWZuZGVmIE5ERUJVRworICAgIC8qIFVwZGF0ZSBzdGF0aXN0aWNzICovCisgICAgZGlzcGF0Y2hlclN0YXRzLmxvb3BSdW5DbnQrKzsKKyNlbmRpZgorCisgICAgLyogUmVidWlsZCB0aGUgcHJpb3JpdHkgdGFibGUgaWYgbmVlZGVkICovCisgICAgaWYgKHJlYnVpbGRUYWJsZSkKKyAgICB7CisgICAgICAgIGl4UU1nckRpc3BhdGNoZXJSZUJ1aWxkUHJpb3JpdHlUYWJsZSAoKTsKKyAgICB9Cit9CisKK3ZvaWQKK2l4UU1nckRpc3BhdGNoZXJMb29wUnVuQjBMTFAgKEl4UU1nckRpc3BhdGNoR3JvdXAgZ3JvdXApCit7CisgICAgVUlOVDMyIGludFJlZ1ZhbCA9MDsgICAgICAgICAgICAgICAgLyogSW50ZXJydXB0IHJlZyB2YWwgKi8KKyAgICBVSU5UMzIgaW50UmVnQ2hlY2tNYXNrOyAgICAgICAgICAvKiBNYXNrIGZvciBjaGVja2luZyBpbnRlcnJ1cHQgYml0cyAqLworICAgIEl4UU1nclFJbmZvICpjdXJyRGlzcGF0Y2hRSW5mbzsKKworICAgIGludCBwcmlvcml0eVRh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B3cml0ZSBiYWNrIGF0IHRoaXMgcG9pbnQgYmVjYXVzZSB0aGUgY29uZGl0aW9uCisgICAgICAgICAgICAgKiBoYXMgbm90IGJlZW4gY2xlYXJlZC4gVGFrZSBhIGNvcHkgYW5kIHdyaXRlIGJhY2sgbGF0ZXIgYWZ0ZXIKKyAgICAgICAgICAgICAqIHRoZSBjb25kaXRpb24gaGFzIGJlZW4gY2xlYXJlZAorICAgICAgICAgICAgICovCisgICAgICAgICAgICBpbnRSZWdWYWxDb3B5ID0gaW50UmVnVmFsOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyogbm8gc3RpY2t5IGZvciB1cHBlciBRJ3MsIHNvIHdyaXRlIGJhY2sgbm93ICovCisgICAgICAgICAgICBpeFFNZ3JBcW1JZlFJbnRlcnJ1cHRSZWdXcml0ZSAoZ3JvdXAsIGludFJlZ1ZhbCk7CisgICAgICAgIH0KKworICAgICAgICAvKiBnZXQgdGhlIGZpcnN0IHF1ZXVlIElkIGZyb20gdGhlIGludGVycnVwdCByZWdpc3RlciB2YWx1ZSAqLworICAgICAgICBxSW5kZXggPSAoQklUU19QRVJfV09SRCAtIDEpIC0gaXhRTWdyQ291bnRMZWFkaW5nWmVyb3MoaW50UmVnVmFsKTsKKworICAgICAgICBpZiAoSVhfUU1HUl9RVUVVUFBfR1JPVVAgPT0gZ3JvdXApCisgICAgICAgIHsKKyAgICAgICAgICAgIC8qIFNldCB0aGUgcXVldWUgcmFuZ2UgYmFzZWQgb24gdGhlIHF1ZXVlIGdyb3VwIHRvIHByb2NjZXNzICovCisgICAgICAgICAgICBxSW5kZXggKz0gSVhfUU1HUl9NSU5fUVVFVVBQX1FJRDsKKyAgICAgICAgfQorCisgICAgICAgIC8qIGNoZWNrIGlmIHRoZSBpbnRlcnJ1cHQgcmVnaXN0ZXIgY29udGFpbnMKKyAgICAgICAgKiBvbmx5IDEgYml0IHNldAorICAgICAgICAqIEZvciBleGFtcGxlOgorICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludFJlZ1ZhbCA9IDB4MDAxMAorICAgICAgICAqICAgICAgICAgICAgICAgY3VyckRpc3BhdGNoUUluZm8tPmludFJlZ0NoZWNrTWFzayA9IDB4MDAxMAorICAgICAgICAqICAgIGludFJlZ1ZhbCA9PSBjdXJyRGlzcGF0Y2hRSW5mby0+aW50UmVnQ2hlY2tNYXNrIGlzIFRSVUUuCisgICAgICAgICovCisgICAgICAgIGN1cnJEaXNwYXRjaFFJbmZvID0gJmRpc3BhdGNoUUluZm9bcUluZGV4XTsKKyAgICAgICAgaWYgKGludFJlZ1ZhbCA9PSBjdXJyRGlzcGF0Y2hRSW5mby0+aW50UmVnQ2hlY2tNYXNrKQorICAgICAgICB7CisKKyAgICAgICAgICAgIC8qIAorICAgICAgICAgICAgICogY2hlY2sgaWYgUSB0eXBlIHBlcmlvZGljIC0gIG9ubHkgbG93ZXIgcXVldWVzIGNhbgorICAgICAgICAgICAgICogaGF2ZSB0aGVyZSB0eXBlIHNldCB0byBwZXJpb2RpYyAKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgaWYgKElYX1FNR1JfVFlQRV9SRUFMVElNRV9QRVJJT0RJQyA9PSBpeFFNZ3JRVHlwZXNbcUluZGV4XSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAvKiAKKyAgICAgICAgICAgICAgICAgKiBEaXNhYmxlIHRoZSBub3RpZmljYXRpb25zIG9uIGFueSBzcG9yYWRpY3MgCisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgZm9yIChpPTA7IGkgPD0gSVhfUU1HUl9NQVhfTE9XX1FVRV9UQUJMRV9JTkRFWDsgaSsrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKElYX1FNR1JfVFlQRV9SRUFMVElNRV9TUE9SQURJQyA9PSBpeFFNZ3JRVHlwZXNbaV0pCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGl4UU1nck5vdGlmaWNhdGlvbkRpc2FibGUoaSk7CisjaWZuZGVmIE5ERUJVRworICAgICAgICAgICAgICAgICAgICAgICAgLyogVXBkYXRlIHN0YXRpc3RpY3MgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIGRpc3BhdGNoZXJTdGF0cy5xdWV1ZVN0YXRzW2ldLmRpc2FibGVDb3VudCsrOworI2VuZGlmCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGN1cnJEaXNwYXRjaFFJbmZvLT5jYWxsYmFjayAocUluZGV4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyRGlzcGF0Y2hRSW5mby0+Y2FsbGJhY2tJZCk7CisjaWZuZGVmIE5ERUJVRworICAgICAgICAgICAgLyogVXBkYXRlIHN0YXRpc3RpY3MgKi8KKyAgICAgICAgICAgIGRpc3BhdGNoZXJTdGF0cy5xdWV1ZVN0YXRzW3FJbmRleF0uY2FsbGJhY2tDbnQrKzsKKyNlbmRpZgorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgLyogdGhlIGV2ZW50IGlzIHRyaWdnZXJlZCBieSBtb3JlIHRoYW4gMSBxdWV1ZSwKKyAgICAgICAgICAgICogdGhlIHF1ZXVlIHNlYXJjaCB3aWxsIGJlIHN0YXJ0aW5nIGZyb20gdGhlIGJlZ2lubmluZworICAgICAgICAgICAgKiBvciB0aGUgbWlkZGxlIG9mIHRoZSBwcmlvcml0eSB0YWJsZQorICAgICAgICAgICAgKgorICAgICAgICAgICAgKiB0aGUgc2VyYWNoIHdpbGwgZW5kIHdoZW4gYWxsIHRoZSBiaXRzIG9mIHRoZSBpbnRlcnJ1cHQKKyAgICAgICAgICAgICogcmVnaXN0ZXIgYXJlIGNsZWFyZWQuIFRoZXJlIGlzIG5vIG5lZWQgdG8gbWFpbnRhaW4KKyAgICAgICAgICAgICogYSBzZXBlcmF0ZSB2YWx1ZSBhbmQgdGVzdCBpdCBhdCBlYWNoIGl0ZXJhdGlvbi4KKyAgICAgICAgICAgICovCisgICAgICAgICAgICBpZiAoSVhfUU1HUl9RVUVMT1dfR1JPVVAgPT0gZ3JvdXApCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgLyogY2hlY2sgaWYgYW55IGJpdCByZWxhdGVkIHRvIHF1ZXVlcyBpbiB0aGUgZmlyc3QKKyAgICAgICAgICAgICAgICAgKiBoYWxmIG9mIHRoZSBwcmlvcml0eSB0YWJsZSBpcyBzZXQKKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBpZiAoaW50UmVnVmFsICYgbG93UHJpb3JpdHlUYWJsZUZpcnN0SGFsZk1hc2spCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBwcmlvcml0eVRhYmxlSW5kZXggPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSVhfUU1HUl9NSU5fTE9XX1FVRV9QUklPUklUWV9UQUJMRV9JTkRFWDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcHJpb3JpdHlUYWJsZUluZGV4ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElYX1FNR1JfTUlEX0xPV19RVUVfUFJJT1JJVFlfVEFCTEVfSU5ERVg7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIC8qIGNoZWNrIGlmIGFueSBiaXQgcmVsYXRlZCB0byBxdWV1ZXMgaW4gdGhlIGZpcnN0CisgICAgICAgICAgICAgICAgICogaGFsZiBvZiB0aGUgcHJpb3JpdHkgdGFibGUgaXMgc2V0CisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgaWYgKGludFJlZ1ZhbCAmIHVwcFByaW9yaXR5VGFibGVGaXJzdEhhbGZNYXNrKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcHJpb3JpdHlUYWJsZUluZGV4ID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElYX1FNR1JfTUlOX1VQUF9RVUVfUFJJT1JJVFlfVEFCTEVfSU5ERVg7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHByaW9yaXR5VGFibGVJbmRleCA9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJWF9RTUdSX01JRF9VUFBfUVVFX1BSSU9SSVRZX1RBQkxFX0lOREVYOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyogaXRlcmF0ZSBmb2xsb3dpbmcgdGhlIHByaW9yaXR5IHRhYmxlIHVudGlsIGFsbCB0aGUgYml0cworICAgICAgICAgICAgICogb2YgdGhlIGludGVycnVwdCByZWdpc3RlciBhcmUgY2xlYXJlZC4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgZG8KKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBxSW5kZXggPSBwcmlvcml0eVRhYmxlW3ByaW9yaXR5VGFibGVJbmRleCsrXTsKKyAgICAgICAgICAgICAgICBjdXJyRGlzcGF0Y2hRSW5mbyA9ICZkaXNwYXRjaFFJbmZvW3FJbmRleF07CisgICAgICAgICAgICAgICAgaW50UmVnQ2hlY2tNYXNrID0gY3VyckRpc3BhdGNoUUluZm8tPmludFJlZ0NoZWNrTWFzazsKKworICAgICAgICAgICAgICAgIC8qIElmIHRoaXMgcXVldWUgY2F1c2VkIHRoaXMgaW50ZXJydXB0IHRvIGJlIHJhaXNlZCAqLworICAgICAgICAgICAgICAgIGlmIChpbnRSZWdWYWwgJiBpbnRSZWdDaGVja01hc2spCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAvKiAKKyAgICAgICAgICAgICAgICAgICAgICogY2hlY2sgaWYgUSB0eXBlIHBlcmlvZGljIC0gb25seSBsb3dlciBxdWV1ZXMgY2FuCisgICAgICAgICAgICAgICAgICAgICAqIGhhdmUgdGhlcmUgdHlwZSBzZXQgdG8gcGVyaW9kaWMuIFRoZXJlIGNhbiBvbmx5IGJlIG9uZQorICAgICAgICAgICAgICAgICAgICAgKiBwZXJpb2RpYyBxdWV1ZSwgc28gdGhlIHNwb3JhZGljcyBhcmUgb25seSBkaXNhYmxlZCBvbmNlLgorICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKElYX1FNR1JfVFlQRV9SRUFMVElNRV9QRVJJT0RJQyA9PSBpeFFNZ3JRVHlwZXNbcUluZGV4XSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgLyogCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBEaXNhYmxlIHRoZSBub3RpZmljYXRpb25zIG9uIGFueSBzcG9yYWRpY3MgCisgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaT0wOyBpIDw9IElYX1FNR1JfTUFYX0xPV19RVUVfVEFCTEVfSU5ERVg7IGkrKykKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoSVhfUU1HUl9UWVBFX1JFQUxUSU1FX1NQT1JBRElDID09IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXhRTWdyUVR5cGVzW2ldKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXhRTWdyTm90aWZpY2F0aW9uRGlzYWJsZShpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHJlbW92ZSBmcm9tIGludFJlZ1ZhbCBhcyB3ZSBkb24ndCB3YW50IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiB0byBzZXJ2aWNlIGFueSBzcG9yYWRpY3Mgbm93CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRSZWdWYWwgJj0gfmRpc3BhdGNoUUluZm9baV0uaW50UmVnQ2hlY2tNYXNrOworI2lmbmRlZiBOREVCVUcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogVXBkYXRlIHN0YXRpc3RpY3MgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGF0Y2hlclN0YXRzLnF1ZXVlU3RhdHNbaV0uZGlzYWJsZUNvdW50Kys7CisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBjdXJyRGlzcGF0Y2hRSW5mby0+Y2FsbGJhY2sgKHFJbmRleCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyRGlzcGF0Y2hRSW5mby0+Y2FsbGJhY2tJZCk7CisjaWZuZGVmIE5ERUJVRworICAgICAgICAgICAgICAgICAgICAvKiBVcGRhdGUgc3RhdGlzdGljcyAqLworICAgICAgICAgICAgICAgICAgICBkaXNwYXRjaGVyU3RhdHMucXVldWVTdGF0c1txSW5kZXhdLmNhbGxiYWNrQ250Kys7CisjZW5kaWYKKyAgICAgICAgICAgICAgICAgICAgLyogQ2xlYXIgdGhlIGludGVycnVwdCByZWdpc3RlciBiaXQgKi8KKyAgICAgICAgICAgICAgICAgICAgaW50UmVnVmFsICY9IH5pbnRSZWdDaGVja01hc2s7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgd2hpbGUoaW50UmVnVmFsKTsKKyAgICAgICAgfSAvKkVuZCBvZiBpbnRSZWdWYWwgPT0gY3VyckRpc3BhdGNoUUluZm8tPmludFJlZ0NoZWNrTWFzayAqLworICAgIH0gLyogRW5kIG9mIGludFJlZ1ZhbCAhPSAwICovCisKKyNpZm5kZWYgTkRFQlVHCisgICAgLyogVXBkYXRlIHN0YXRpc3RpY3MgKi8KKyAgICBkaXNwYXRjaGVyU3RhdHMubG9vcFJ1bkNudCsrOworI2VuZGlmCisKKyAgICBpZiAoKGludFJlZ1ZhbENvcHkgIT0gMCkgJiYgKElYX1FNR1JfUVVFTE9XX0dST1VQID09IGdyb3VwKSkKKyAgICB7CisgICAgICAgIC8qIAorICAgICAgICAgKiBsb3dlciBncm91cHMgKHRoZXJlZm9yZSBzdGlja3kpIEFORCBhdCBsZWFzdCBvbmUgZW5hYmxlZCBpbnRlcnJ1cHQKKyAgICAgICAgICogV3JpdGUgYmFjayB0byBjbGVhciB0aGUgaW50ZXJydXB0IAorICAgICAgICAgKi8KKyAgICAgICAgaXhRTWdyQXFtSWZRSW50ZXJydXB0UmVnV3JpdGUgKElYX1FNR1JfUVVFTE9XX0dST1VQLCBpbnRSZWdWYWxDb3B5KTsKKyAgICB9CisKKyAgICAvKiBSZWJ1aWxkIHRoZSBwcmlvcml0eSB0YWJsZSBpZiBuZWVkZWQgKi8KKyAgICBpZiAocmVidWlsZFRhYmxlKQorICAgIHsKKyAgICAgICAgaXhRTWdyRGlzcGF0Y2hlclJlQnVpbGRQcmlvcml0eVRhYmxlICgpOworICAgIH0KK30KKworUFJJVkFURSB2b2lkCitpeFFNZ3JEaXNwYXRjaGVyUmVCdWlsZFByaW9yaXR5VGFibGUgKHZvaWQpCit7CisgICAgVUlOVDMyIHFJbmRleDsKKyAgICBVSU5UMzI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AgICBwcmludGYgKCI9PT0gPT09PT09PT0gPT09PT09PT09ID09PT09PT09PT0gPT09PT09PT09PT09PT0gPT09PT09PT09XG4iKTsKKworICAgIGZvciAoaT0wOyBpPD0gSVhfUU1HUl9NQVhfTE9XX1FVRV9UQUJMRV9JTkRFWDsgaSsrKQorICAgIHsKKyAgICAgICAgcSA9ICZkaXNwYXRjaFFJbmZvW2ldOworCisgICAgICAgIGlmIChpeFFNZ3JRVHlwZXNbaV0gIT0gSVhfUU1HUl9UWVBFX1JFQUxUSU1FX09USEVSKQorICAgICAgICB7CisgICAgICAgICAgICBwcmludGYgKCIgJTJkICIsIGkpOworCisgICAgICAgICAgICBpZiAoaXhRTWdyUVR5cGVzW2ldID09IElYX1FNR1JfVFlQRV9SRUFMVElNRV9TUE9SQURJQykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwcmludGYgKCJTcG9yYWRpYyIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHByaW50ZiAoIlBlcmlvZGljIik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgCisgICAgICAgICAgICBpeFFNZ3JBcW1JZlFJbnRlcnJ1cHRFbmFibGVSZWdSZWFkIChJWF9RTUdSX1FVRUxPV19HUk9VUCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmludEVuYWJsZVJlZ1ZhbCk7CisgICAgICAgICAgICAJCisKKwkgICAgaW50RW5hYmxlUmVnVmFsICY9IGRpc3BhdGNoUUluZm9baV0uaW50UmVnQ2hlY2tNYXNrOworICAgICAgICAgICAgaW50RW5hYmxlUmVnVmFsID0gaW50RW5hYmxlUmVnVmFsID4+IGk7CisKKyAgICAgICAgICAgIHByaW50ZiAoIiAlMTBkICUxMGQgJTEwZCAlMTBkXG4iLAorICAgICAgICAgICAgICAgICAgICBkaXNwYXRjaGVyU3RhdHMucXVldWVTdGF0c1tpXS5lbmFibGVDb3VudCwKKyAgICAgICAgICAgICAgICAgICAgZGlzcGF0Y2hlclN0YXRzLnF1ZXVlU3RhdHNbaV0uZGlzYWJsZUNvdW50LAorICAgICAgICAgICAgICAgICAgICBpbnRFbmFibGVSZWdWYWwsCisgICAgICAgICAgICAgICAgICAgIGRpc3BhdGNoZXJTdGF0cy5xdWV1ZVN0YXRzW2ldLmNhbGxiYWNrQ250KTsKKworICAgICAgICAgICAgaWYgKHJlc2V0U3RhdHMpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgZGlzcGF0Y2hlclN0YXRzLnF1ZXVlU3RhdHNbaV0uZW5hYmxlQ291bnQgPQorICAgICAgICAgICAgICAgIGRpc3BhdGNoZXJTdGF0cy5xdWV1ZVN0YXRzW2ldLmRpc2FibGVDb3VudCA9IAorICAgICAgICAgICAgICAgIGRpc3BhdGNoZXJTdGF0cy5xdWV1ZVN0YXRzW2ldLmNhbGxiYWNrQ250ID0gMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKyNlbHNlCisgICAgSVhfUU1HUl9MT0cwKCJMaXZlbG9jayBQcmV2ZW50aW9uIHN0YXRpc3RpY3MgYXJlIG9ubHkgY29sbGVjdGVkIGluIGRlYnVnIG1vZGVcbiIpOworI2VuZGlmCit9CisKK3ZvaWQKK2l4UU1nclBlcmlvZGljRG9uZSAodm9pZCkKK3sKKyAgICBVSU5UMzIgaSA9IDA7CisgICAgVUlOVDMyIGl4UU1nckxvY2tLZXkgPSAwOworCisgICAgLyogCisgICAgICogZm9yIHRoZSBsb3dlciBxdWV1ZXMKKyAgICAgKi8KKyAgICBmb3IgKGk9MDsgaSA8PSBJWF9RTUdSX01BWF9MT1dfUVVFX1RBQkxFX0lOREVYOyBpKyspCisgICAgeworICAgICAgICAvKgorICAgICAgICAgKiBjaGVjayBmb3Igc3BvcmFkaWNzIAorICAgICAgICAgKi8KKyAgICAgICAgaWYgKElYX1FNR1JfVFlQRV9SRUFMVElNRV9TUE9SQURJQyA9PSBpeFFNZ3JRVHlwZXNbaV0pCisgICAgICAgIHsKKyAgICAgICAgICAgICAvKiAKKyAgICAgICAgICAgICAgKiBlbmFibGUgYW55IHNwb3JhZGljcyAKKyAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICBpeFFNZ3JMb2NrS2V5ID0gaXhPc2FsSXJxTG9jaygpOworICAgICAgICAgICAgIGl4UU1nckFxbUlmUUludGVycnVwdEVuYWJsZShpKTsKKyAgICAgICAgICAgICBpeE9zYWxJcnFVbmxvY2soaXhRTWdyTG9ja0tleSk7CisjaWZuZGVmIE5ERUJVRworICAgICAgICAgICAgIC8qIAorICAgICAgICAgICAgICAqIFVwZGF0ZSBzdGF0aXN0aWNzIAorICAgICAgICAgICAgICAqLworICAgICAgICAgICAgIGRpc3BhdGNoZXJTdGF0cy5xdWV1ZVN0YXRzW2ldLmVuYWJsZUNvdW50Kys7CisgICAgICAgICAgICAgZGlzcGF0Y2hlclN0YXRzLnF1ZXVlU3RhdHNbaV0ubm90aWZpY2F0aW9uRW5hYmxlZCA9IFRSVUU7CisjZW5kaWYKKyAgICAgICAgfQorICAgIH0KK30KK0lYX1NUQVRVUworaXhRTWdyQ2FsbGJhY2tUeXBlU2V0IChJeFFNZ3JRSWQgcUlkLCAKKyAgICAgICAgICAgICAgICAgICAgICAgSXhRTWdyVHlwZSB0eXBlKQoreworICAgIFVJTlQzMiBpeFFNZ3JMb2NrS2V5ID0gMDsKKyAgICBJeFFNZ3JUeXBlIGl4UU1nck9sZFR5cGUgPTA7CisKKyNpZm5kZWYgTkRFQlVHCisgICAgaWYgKCFpeFFNZ3JRSXNDb25maWd1cmVkKHFJZCkpCisgICAgeworICAgICAgICByZXR1cm4gSVhfUU1HUl9RX05PVF9DT05GSUdVUkVEOworICAgIH0KKyAgICBpZiAocUlkID49IElYX1FNR1JfTUlOX1FVRVVQUF9RSUQpCisgICAgeworICAgICAgICByZXR1cm4gSVhfUU1HUl9QQVJBTUVURVJfR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AmdXBJbnRSZWdSZWFkKTsKKyAgICBwcmludGYoIkdlbmVyaWMgU3RhdHMuLi4uLi4uLlxuIik7CisgICAgcHJpbnRmKCI9PT09PT09PT09PT09PT09PT09PT1cbiIpOworICAgIHByaW50ZigiTG9vcCBSdW4gQ291bnQuLi4uLi4uLi4uJXVcbiIsZGlzcGF0Y2hlclN0YXRzLT5sb29wUnVuQ250KTsKKyAgICBwcmludGYoIldhdGVybWFyayBzZXQgY291bnQuLi4uLiVkXG4iLCBxQ2ZnU3RhdHMtPndtU2V0Q250KTsKKyAgICBwcmludGYoIj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIpOworICAgIHByaW50ZigiT24gdGhlIGZseSBJbnRlcnJ1cHQgUmVnaXN0ZXIgU3RhdHMuLi4uLi4uLlxuIik7CisgICAgcHJpbnRmKCI9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4iKTsKKyAgICBwcmludGYoIkxvd2VyIEludGVycnVwdCBSZWdpc3Rlci4uLi4uLi4uLi4uLjB4JTA4eFxuIixsb3dJbnRSZWdSZWFkKTsKKyAgICBwcmludGYoIlVwcGVyIEludGVycnVwdCBSZWdpc3Rlci4uLi4uLi4uLi4uLjB4JTA4eFxuIix1cEludFJlZ1JlYWQpOworICAgIHByaW50ZigiPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuIik7CisgICAgcHJpbnRmKCJRdWV1ZSBTcGVjaWZpYyBTdGF0cy4uLi4uLi4uXG4iKTsKKyAgICBwcmludGYoIj09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiIpOworCisgICAgZm9yIChpPTA7IGk8SVhfUU1HUl9NQVhfTlVNX1FVRVVFUzsgaSsrKQorICAgIHsKKwlpZiAoaXhRTWdyUUlzQ29uZmlndXJlZChpKSkKKwl7CisJICAgIGl4UU1nclFTaG93KGkpOworCX0KKyAgICB9CisKKyAgICBwcmludGYoIj09PT09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GNhc2UgSVhfUU1HUl9RX1NPVVJDRV9JRF9ORjoKKyAgICAgICAgICAgICAgICBsb2NhbEV2ZW50ID0gIk5lYXJseSBGdWxsIjsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgSVhfUU1HUl9RX1NPVVJDRV9JRF9GOgorICAgICAgICAgICAgICAgIGxvY2FsRXZlbnQgPSAiRnVsbCI7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIElYX1FNR1JfUV9TT1VSQ0VfSURfTk9UX0U6CisgICAgICAgICAgICAgICAgbG9jYWxFdmVudCA9ICJOb3QgRW1wdHkiOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBJWF9RTUdSX1FfU09VUkNFX0lEX05PVF9ORToKKyAgICAgICAgICAgICAgICBsb2NhbEV2ZW50ID0gIk5vdCBOZWFybHkgRW1wdHkiOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBJWF9RTUdSX1FfU09VUkNFX0lEX05PVF9ORjoKKyAgICAgICAgICAgICAgICBsb2NhbEV2ZW50ID0gIk5vdCBOZWFybHkgRnVsbCI7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIElYX1FNR1JfUV9TT1VSQ0VfSURfTk9UX0Y6CisgICAgICAgICAgICAgICAgbG9jYWxFdmVudCA9ICJOb3QgRnVsbCI7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0IDoKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBwcmludGYoIiAgICBOb3RpZmljYXRpb25zIGxvY2FsRXZlbnQuLi4uLi4gJXNcbiIsIGxvY2FsRXZlbnQpOworICAgIH0KKyAgICBlbHNlCisgICAgeworICAgICAgICBwcmludGYoIiAgICBOb3RpZmljYXRpb25zLi4uLi4uLi4uLi4uIG5vdCBlbmFibGVkXG4iK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IGRlZmluaXRpb25zLgorICovCit2b2lkCitpeFFNZ3JRQWNjZXNzSW5pdCAodm9pZCkKK3sgICAKK30KKworSVhfU1RBVFVTCitpeFFNZ3JRUmVhZFdpdGhDaGVja3MgKEl4UU1nclFJZCBxSWQsCisgICAgICAgICAgICAgICAgICAgICAgIFVJTlQzMiAqZW50cnkpCit7CisgICAgSXhRTWdyUUVudHJ5U2l6ZUluV29yZHMgZW50cnlTaXplSW5Xb3JkczsKKyAgICBJeFFNZ3JRSW5saW5lZFJlYWRXcml0ZUluZm8gKmluZm9QdHI7CisKKyAgICBpZiAoTlVMTCA9PSBlbnRyeSkKKyAgICB7CisJcmV0dXJuIElYX1FNR1JfUEFSQU1FVEVSX0VSUk9SOworICAgIH0KKworICAgIC8qIENoZWNrIFFJZCAqLworICAgIGlmICghaXhRTWdyUUlzQ29uZmlndXJlZChxSWQpKQorICAgIHsKKwlyZXR1cm4gSVhfUU1HUl9RX05PVF9DT05GSUdVUkVEOworICAgIH0KKworICAgIC8qIEdldCB0aGUgcSBlbnRyeSBzaXplIGluIHdvcmRzICovCisgICAgZW50cnlTaXplSW5Xb3JkcyA9IGl4UU1nclFFbnRyeVNpemVJbldvcmRzR2V0IChxSWQpOworCisgICAgaXhRTWdyQXFtSWZRUG9wIChxSWQsIGVudHJ5U2l6ZUluV29yZHMsIGVudHJ5KTsJICAgIAorCisgICAgLyogcmVzZXQgdGhlIGN1cnJlbnQgcmVhZCBjb3VudCBpZiB0aGUgY291bnRlciB3cmFwcGVkIGFyb3VuZCAKKyAgICAqICh1bnNpZ25lZCBhcml0aG1ldGljKQorICAgICovCisgICAgaW5mb1B0ciA9ICZpeFFNZ3JRSW5saW5lZFJlYWRXcml0ZUluZm9bcUlkXTsKKyAgICBpZiAoaW5mb1B0ci0+cVJlYWRDb3VudC0tID4gaW5mb1B0ci0+cVNpemVJbkVudHJpZXMpCisgICAgeworCWluZm9QdHItPnFSZWFkQ291bnQgPSAwOworICAgIH0KKworICAgIC8qIENoZ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XggPj0gSVhfUU1HUl9RX1NJWkVfSU5WQUxJRCkpCisgICAgeworCXJldHVybiBJWF9RTUdSX1BBUkFNRVRFUl9FUlJPUjsKKyAgICB9CisKKyAgICBpZiAoIWl4UU1nclFJc0NvbmZpZ3VyZWQocUlkKSkKKyAgICB7CisJcmV0dXJuIElYX1FNR1JfUV9OT1RfQ09ORklHVVJFRDsKKyAgICB9CisjZW5kaWYKKyAgICAKKyAgICBpZiAoSVhfU1VDQ0VTUyAhPSBpeFFNZ3JRTnVtRW50cmllc0dldCAocUlkLCAmbnVtRW50cmllcykpCisgICAgeworCXJldHVybiBJWF9GQUlMOworICAgIH0KKworICAgIGlmIChlbnRyeUluZGV4ID49IG51bUVudHJpZXMpIC8qIGVudHJ5SW5kZXggc3RhcnRzIGF0IDAgKi8KKyAgICB7CisJcmV0dXJuIElYX1FNR1JfRU5UUllfSU5ERVhfT1VUX09GX0JPVU5EUzsKKyAgICB9CisKKyAgICByZXR1cm4gaXhRTWdyQXFtSWZRUGVlayAocUlkLCBlbnRyeUluZGV4LCBlbnRyeSk7Cit9CisKK0lYX1NUQVRVUworaXhRTWdyUVBva2UgKEl4UU1nclFJZCBxSWQsCisJICAgICB1bnNpZ25lZCBlbnRyeUluZGV4LAorCSAgICAgVUlOVDMyICplbnRyeSkKK3sKKyAgICB1bnNpZ25lZCBpbnQgbnVtRW50cmllczsKKworI2lmbmRlZiBOREVCVUcKKyAgICBpZiAoKE5VTEwgPT0gZW50cnkpIHx8IChlbnRyeUluZGV4ID4gMTI4KSkKKyAgICB7CisJcmV0dXJuIElYX1FNR1JfUEFSQU1FVEVSX0VSUk9SOworICAgIH0KKworICAgIGlmICghaXhRTWdyUUlzQ29uZmlndXJlZChxSWQpKQorICAgIHsKKwlyZXR1cm4gSVhfUU1HUl9RX05PVF9DT05GSUdVUkVEOworICAgIH0KKyNlbmRpZgorICAgICAgICAKKyAgICBpZiAoSVhfU1VDQ0VTUyAhPSBpeFFNZ3JRTnVtRW50cmllc0dldCAocUlkLCAmbnVtRW50cmllcykpCisgICAgeworCXJldHVybiBJWF9GQUlMOworICAgIH0KKworICAgIGlmIChudW1FbnRyaWVzIDwgKGVudHJ5SW5kZXggKyAxKSkgLyogZW50cnlJbmRleCBzdGFydHMgYXQgMCAqLworICAgIHsKKwlyZXR1cm4gSVhfUU1HUl9FTlRSWV9JTkRFWF9PVVRfT0ZfQk9VTkRTOworICAgIH0KKworICAgIHJldHVybiBpeFFNZ3JBcW1JZlFQb2tlIChxSWQsIGVudHJ5SW5kZXgsIGVudHJ5KTsKK30KKworSVhfU1RBVFVTCitpeFFNZ3JRU3RhdHVzR2V0V2l0aENoZWNrcyAoSXhRTWdyUUlkIHFJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBJeFFNZ3JRU3RhdHVzICpxU3RhdHVzKQoreworICAgIGlmIChOVUxMID09IHFTdGF0dXMpCisgICAgeworCXJldHVybiBJWF9RTUdSX1BBUkFNRVRFUl9FUlJPUjsKKyAgICB9CisgICAKKyAgICBpZiAoIWl4UU1nclFJc0NvbmZpZ3VyZWQgKHFJZCkpIAorICAgIHsKKyAgICAgICAgcmV0dXJuIElYX1FNR1JfUV9OT1RfQ09ORklHVVJFRDsKKyAgICB9CisKKyAgICBpeFFNZ3JBcW1JZlF1ZVN0YXRSZWFkIChxSWQsIHFTdGF0dXMpOworCisgICAgcmV0dXJuIElYX1NVQ0NFU1M7Cit9CisKK0lYX1NUQVRVUworaXhRTWdyUU51bUVudHJpZXNHZXQgKEl4UU1nclFJZCBxSWQsCisJCSAgICAgIHVuc2lnbmVkICpudW1FbnRyaWVzUHRyKQoreworICAgIFVJTlQzMiBxUHRyczsKKyAgICBVSU5UMzIgcVN0YXR1czsKKyAgICB1bnNpZ25lZCBudW1FbnRyaWVzOworICAgIEl4UU1nclFJbmxpbmVkUmVhZFdyaXRlSW5mbyAqaW5mb1B0cjsKKworCisjaWZuZGVmIE5ERUJVRworICAgIGlmIChOVUxMID09IG51bUVudHJpZXNQdH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PSAobnVtRW50cmllcyAvIGluZm9QdHItPnFFbnRyeVNpemVJbldvcmRzKSAmIChpbmZvUHRyLT5xU2l6ZUluRW50cmllcyAtIDEpOworICAgIH0KKyAgICAKKyAgICByZXR1cm4gSVhfU1VDQ0VTUzsKK30KKworI2lmIGRlZmluZWQoX193aW5jZSkgJiYgZGVmaW5lZChOT19JTkxJTkVfQVBJUykKKworUFVCTElDIElYX1NUQVRVUworaXhRTWdyUVJlYWQgKEl4UU1nclFJZCBxSWQsCisgICAgICBVSU5UMzIgKmVudHJ5UHRyKQoreworICAgIGV4dGVybiBJeFFNZ3JRSW5saW5lZFJlYWRXcml0ZUluZm8gaXhRTWdyUUlubGluZWRSZWFkV3JpdGVJbmZvW107CisgICAgSXhRTWdyUUlubGluZWRSZWFkV3JpdGVJbmZvICppbmZvUHRyID0gJml4UU1nclFJbmxpbmVkUmVhZFdyaXRlSW5mb1txSWRdOworICAgIFVJTlQzMiBlbnRyeSwgZW50cnlTaXplOworCisgICAgLyogZ2V0IGEgbmV3IGVudHJ5ICovCisgICAgZW50cnlTaXplID0gaW5mb1B0ci0+cUVudHJ5U2l6ZUluV29yZHM7CisgICAgZW50cnkgPSBJWF9PU0FMX1JFQURfTE9ORyhpbmZvUHRyLT5xQWNjUmVnQWRkcik7CisKKyAgICBpZiAoZW50cnlTaXplICE9IElYX1FNR1JfUV9FTlRSWV9TSVpFMSkKKyAgICB7IAorICAgICplbnRyeVB0ciA9IGVudHJ5OworICAvKiBwcm9jZXNzIHRoZSByZW1haW5pbmcgcGFydCBvZiB0aGUgZW50cnkgKi8KKyAgIHJldHVybiBpeFFNZ3JRUmVhZE1Xb3Jkc01pbnVzMShxSWQsIGVudHJ5UHRyKTsKKyAgICB9CisKKyAgICAvKiB1bmRlcmZsb3cgaXMgYXZhaWxhYmxlIGZvciBsb3dlciBxdWV1ZXMgb25seSAqLworICAgIGlmIChxSWQgPCBJWF9RTUdSX01JTl9RVUVVUFBfUUlEKQorICAgIHsKKyAvKiB0aGUgY291bnRlciBvZiBxdWV1ZSBlbnRyaWVzIGlzIGRlY3JlbWVudGVkLiBJbiBoYXBweSAKKyAgICAqIGRheSBzY2VuYXJpbyB0aGVyZSBhcmUgbWFueSBlbnRyaWVzIGluIHRoZSBxdWV1ZQorICAqIGFuZCB0aGUgY291bnRlciBkb2VzIG5vdCByZWFjaCB6ZXJvLgorICAqLworICAgICBpZiAoaW5mb1B0ci0+cVJlYWRDb3VudC0tID09IDApCisgeworICAgICAgIC8qIFRoZXJlIGlzIG1heWJlIG5vIGVudHJ5IGluIHRoZSBxdWV1ZQorICAgICAgKiBxUmVhZENvdW50IGlzIG5vdyBuZWdhdGl2ZSwgYnV0IHdpbGwgYmUgY29ycmVjdGVkIGJlZm9yZQorICAgICAgKiB0aGUgZnVuY3Rpb24gcmV0dXJucy4KKyAgICAgICAgICovCisgICAgIFVJTlQzMiBxUHRyczsgLyogcXVldWUgaW50ZXJuYWwgcG9pbnRlcnMgKi8KKworICAgICAvKiB3aGVuIGEgcXVldWUgaXMgZW1wdHksIHRoZSBodyBndWFyYW50ZWVzIHRvIHJldHVybiAKKyAgICAgICAqIGEgbnVsbCB2YWx1ZS4gSWYgdGhlIHZhbHVlIGlzIG5vdCBudWxsLCB0aGUgcXVldWUgaXMKKyAgICAgICogbm90IGVtcHR5LgorICAgICAgICAqLworICAgICBpZiAoZW50cnkgPT0gMCkKKyAgICAgeworICAgICAgIC8qIGdldCB0aGUgcXVldWUgc3RhdHVzICovCisgICAgICBVSU5UMzIgc3RhdHVzID0gSVhfT1NBTF9SRUFEX0xPTkcoaW5mb1B0ci0+cVVPU3RhdFJlZ0FkZHIpOworICAgCisgICAgICAgIC8qIGNoZWNrIHRoZSB1bmRlcmZsb3cgc3RhdHVzICovCisgICAgICAgIGlmIChzdGF0dXMgJiBpbmZvUHRyLT5xVWZsb3dTdGF0Qml0TWFzaykKKyAgICAgICAgeworICAgICAgICAgICAvKiB0aGUgcXVldWUgaXMgZW1wdHkgCisgICAgICAgICAgKiAgY2xlYXIgdGhlIHVuZGVyZmxvdyBzdGF0dXMgYml0IGlmIGl0IHdhcyBzZXQgCisgICAgICAgICAgICAqLworICAgICAgICAgIElYX09TQUxfV1JJVEVfTE9ORyhpbmZvUHRyLT5xVU9TdGF0UmVnQWRkciwKKyAgICAgICAgICAgICAgICAgICAgc3RhdHVzICYgfmluZm9QdHItPnFVZmxvd1N0YXRCaXRNYXNrKTsKKyAgICAgICAgICplbnRyeVB0ciA9IDA7CisgICAgICAgICAgaW5mb1B0ci0+cVJlYWRDb3VudCA9IDA7CisgICAgICAgICAgICByZXR1cm4gSVhfUU1HUl9RX1VOREVSRkxPVzsKKyAgICAgfQorICAgICAgIH0KKyAgICAgICAvKiBzdG9yZSB0aGUgcmVzdWx0ICovCisgICAgICAqZW50cnlQdHIgPSBlbnRyeTsKKworICAgICAgLyogTm8gdW5kZXJmbG93IG9jY3VyZWQgOiBzb21lb25lIGlzIGZpbGxpbmcgdGhlIHF1ZXVlCisgICAgICAgKiBvciB0aGUgcXVldWUgY29udGFpbnMgbnVsbCBlbnRyaWVzLgorICAgICAgICogVGhlIGN1cnJlbnQgY291bnRlciBuZWVkcyB0byBiZQorICAgICAgICogdXBkYXRlZCBmcm9tIHRoZSBjdXJyZW50IG51bWJlciBvZiBlbnRyaWVzIGluIHRoZSBxdWV1ZQorICAgICAgICovCisKKyAgICAgLyogZ2V0IHNuYXBzaG90IG9mIHF1ZXVlIHBvaW50ZXJzICovCisgICAgICAgIHFQdHJzID0gSVhfT1NBTF9SRUFEX0xPTkcoaW5mb1B0ci0+cUNvbmZpZ1JlZ0FkZHIpOworCisgICAgICAgLyogTW9kIHN1YnRyYWN0aW9uIG9mIHBvaW50ZXJzIHRvIGdldCBudW1iZXIgb2Ygd29yZHMgaW4gUS4gKi8KKyAgICAgIHFQdHJzID0gKHFQdHJzIC0gKHFQdHJzID4+IDcpKSAmIDB4N2Y7IAorICAKKyAgICAgICBpZiAocVB0cnMgPT0gMCkKKyAgICAge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qIHdyaXRlIHRoZSBwcmUtZmV0Y2hlZCBlbnRyeSAqLworICAgKmVudHJpZXMgPSBudWxsQ2hlY2tFbnRyeTsKKyAgICB9CisgICAgZWxzZQorICAgIHsKKyAgICBJeFFNZ3JRRW50cnlTaXplSW5Xb3JkcyBlbnRyeVNpemVJbldvcmRzID0gaW5mb1B0ci0+cUVudHJ5U2l6ZUluV29yZHM7CisgIC8qIHJlYWQgdGhlIHNwZWNpZmllZCBudW1iZXIgb2YgcXVldWUgZW50cmllcyAqLworICAgIG51bGxDaGVja0VudHJ5ID0gMDsKKyB3aGlsZSAobnVtRW50cmllcy0tKQorICAgIHsKKyAgICAgICBpbnQgaTsKKworICAgICAgZm9yIChpID0gMDsgaSA8IGVudHJ5U2l6ZUluV29yZHM7IGkrKykKKyAgICAgIHsKKyAgICAgICAqZW50cmllcyA9IElYX09TQUxfUkVBRF9MT05HKGluZm9QdHItPnFBY2NSZWdBZGRyICsgaSk7CisgICAgICAgbnVsbENoZWNrRW50cnkgfD0gKmVudHJpZXMrKzsKKyAgICAgICB9CisKKyAgICAgICAvKiBpZiB3ZSByZWFkIGEgTlVMTCBlbnRyeSwgc3RvcC4gV2UgaGF2ZSB1bmRlcmZsb3dlZCAqLworICAgICAgICBpZiAobnVsbENoZWNrRW50cnkgPT0gMCkKKyAgICAgICAgeworICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgIG51bGxDaGVja0VudHJ5ID0gMDsKKyB9CisgICAgfQorCisgICAgLyogcmVzZXQgdGhlIGN1cnJlbnQgcmVhZCBjb3VudCA6IG5leHQgYWNjZXNzIHRvIHRoZSByZWFkIGZ1bmN0aW9uIAorICAgICAqIHdpbGwgZm9yY2UgYSB1bmRlcmZsb3cgc3RhdHVzIGNoZWNrIAorICAgICAqLworICAgIGluZm9QdHItPnFXcml0ZUNvdW50ID0gMDsKKworICAgIC8qIENoZWNrIGlmIHVuZGVyZmxvdyBvY2N1cnJlZCBvbiB0aGUgcmVhZCAqLworICAgIGlmI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QdHItPnFDb25maWdSZWdBZGRyKTsKKworICAgICAgIC8qIE1vZCBzdWJ0cmFjdGlvbiBvZiBwb2ludGVycyB0byBnZXQgbnVtYmVyIG9mIHdvcmRzIGluIFEuICovCisgICAgICBxUHRycyA9IChxUHRycyAtIChxUHRycyA+PiA3KSkgJiAweDdmOyAKKworICAgICBpZiAocVB0cnMgPT0gMCkKKyAgICAgeworICAgICAgIC8qIHRoZSBxdWV1ZSBtYXkgYmUgZnVsbCBhdCB0aGUgdGltZSBvZiB0aGUgCisgICAgICAgICAqIHNuYXBzaG90LiBOZXh0IGFjY2VzcyB3aWxsIGNoZWNrIAorICAgICAgICAgKiB0aGUgb3ZlcmZsb3cgc3RhdHVzIGFnYWluLgorICAgICAgICAqLworICAgICBpbmZvUHRyLT5xV3JpdGVDb3VudCA9IHFTaXplOworICAgICAgIH0KKyAgICAgICBlbHNlIAorICAgICAgIHsKKyAgICAgICAvKiBjb252ZXJ0IHRoZSBudW1iZXIgb2Ygd29yZHMgdG8gYSBudW1iZXIgb2YgZW50cmllcyAqLworICAgICAgICBpZiAoZW50cnlTaXplID09IElYX1FNR1JfUV9FTlRSWV9TSVpFMSkKKyAgICAgeworICAgICAgICAgICBpbmZvUHRyLT5xV3JpdGVDb3VudCA9IHFQdHJzICYgKHFTaXplIC0gMSk7CisgICAgIH0KKyAgICAgICBlbHNlCisgICAgICAgIHsKKyAgICAgICAgICAgaW5mb1B0ci0+cVdyaXRlQ291bnQgPSAocVB0cnMgLyBlbnRyeVNpemUpICYgKHFTaXplIC0gMSk7CisgICAgICAgfQorICAgICAgIH0KKyAgIH0KKyAgICB9CisgICAgcmV0dXJuIElYX1NVQ0NFU1M7Cit9CisKK1BVQkxJQyBJWF9TVEFUVVMKK2l4UU1nclFCdXJzdFdyaXRlIChJeFFNZ3JRSWQgcUlkLAorICAgICAgICAgIHVuc2lnbmVkIG51bUVudHJpZXMsCisgICAgICAgIFVJTlQzMiAqZW50cmllcykKK3sKKyAgICBleHRlcm4gSXhRTWdyUUlubGluZWRSZWFkV3JpdGVJbmZvIGl4UU1nclFJbmxpbmVkUmVhZFdyaXRlSW5mb1tdOworICAgIEl4UU1nclFJbmxpbmVkUmVhZFdyaXRlSW5mbyAqaW5mb1B0ciA9ICZpeFFNZ3JRSW5saW5lZFJlYWRXcml0ZUluZm9bcUlkXTsKKyAgICBVSU5UMzIgc3RhdHVzOworCisgICAgLyogdXBkYXRlIHRoZSBjdXJyZW50IHdyaXRlIGNvdW50ICovCisgICAgaW5mb1B0ci0+cVdyaXRlQ291bnQgKz0gbnVtRW50cmllczsKKworICAgIGlmIChpbmZvUHRyLT5xRW50cnlTaXplSW5Xb3JkcyA9PSBJWF9RTUdSX1FfRU5UUllfU0laRTEpCisgICAgeworICAgIHZvbGF0aWxlIFVJTlQzMiAqcUFjY1JlZ0FkZHIgPSBpbmZvUHRyLT5xQWNjUmVnQWRkcjsKKyAgICB3aGlsZSAobnVtRW50cmllcy0tKQorICAgIHsKKyAgICAgICBJWF9PU0FMX1dSSVRFX0xPTkcocUFjY1JlZ0FkZHIsICplbnRyaWVzKTsKKyAgICAgICAgZW50cmllcysrOworICB9CisgICAgfQorICAgIGVsc2UKKyAgICB7CisgSXhRTWdyUUVudHJ5U2l6ZUluV29yZHMgZW50cnlTaXplSW5Xb3JkcyA9IGluZm9QdHItPnFFbnRyeVNpemVJbldvcmRzOworICBpbnQgaTsKKworICAvKiB3cml0ZSBlYWNoIHF1ZXVlIGVudHJ5ICovCisgICAgd2hpbGUgKG51bUVudHJpZXMtLSkKKyAgICB7CisgICAgICAgLyogd3JpdGUgdGhlIHF1ZXVlRW50cnlTaXplIG51bWJlciBvZiB3b3JkcyBmb3IgZWFjaCBlbnRyeSAqLworICAgICAgIGZvciAoaSA9IDA7IGkgPCBlbnRyeVNpemVJbldvcmRzOyBpKyspCisgICAgICB7CisgICAgICAgSVhfT1NBTF9XUklURV9MT05HKChpbmZvUHRyLT5xQWNjUmVnQWRkciArIGkpLCAqZW50cmllcyk7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gICMgICAjICAjICAgICAgIyAgICAgIyAgIyAgICAgICAgICAgIyAgICAjICAgIyAgIyAgICAgICMgICAgIyAgICAjCisgIyAgICAjICAjICAgICMgICAgICMgICAgIyAgICAjICAgICAgICAgICMgICAgIyAgIyAgICAjICAgICAjICAgICMjIyMjIworICMgICAgIyAgIyMjIyMjICAgICAjICAgICMjIyMjIyAgICAgICAgICAjIyMjIyAgICMjIyMjIyAgICAgIyAgICAjICAgICMKKyAjICAgICMgICMgICAgIyAgICAgIyAgICAjICAgICMgICAgICAgICAgIyAgICAgICAjICAgICMgICAgICMgICAgIyAgICAjCisgIyMjIyMgICAjICAgICMgICAgICMgICAgIyAgICAjICAgICAgICAgICMgICAgICAgIyAgICAjICAgICAjICAgICMgICAgIworCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisKKy8qKgorICogQGluZ3JvdXAgSXhFdGhBY2MKKyAqCisgKiBAZm4gaXhFdGhBY2NQb3J0VHhGcmFtZVN1Ym1pdCggCisgICAgSXhFdGhBY2NQb3J0SWQgcG9ydElkLAorICAgIElYX09TQUxfTUJVRiAqYnVmZmVyLCAKKyAgICBJeEV0aEFjY1R4UHJpb3JpdHkgcHJpb3JpdHkpCisgKiAKKyAqIEBicmllZiBUaGlzIGZ1bmN0aW9uIHNoYWxsIGJlIHVzZWQgdG8gc3VibWl0IE1CVUZzIGJ1ZmZlcnMgZm9yIHRyYW5zbWlzc2lvbiBvbiBhIHBhcnRpY3VsYXIgTUFDIGRldmljZS4gCisgKgorICogV2hlbiB0aGUgZnJhbWUgaXMgdHJhbnNtaXR0ZWQsIHRoZSBidWZmZXIgc2hhbGwgYmUgcmV0dXJuZWQgdGhydSB0aGUgCisgKiBjYWxsYmFjayBAYSBJeEV0aEFjY1BvcnRUeERvbmVDYWxsYmFjay4KKyAqCisgKiBJbiBjYXNlIG9mIG92ZXItc3VibWl0dGluZywgdGhlIG9yZGV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RSeEZyZWVSZXBsZW5pc2goIEl4RXRoQWNjUG9ydElkIHBvcnRJZCwgSVhfT1NBTF9NQlVGICpidWZmZXIpOworCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorCisgICMjIyMgICAgIyMjIyAgICMgICAgIyAgICMjIyMjICAjIyMjIyAgICAjIyMjICAgIworICMgICAgIyAgIyAgICAjICAjIyAgICMgICAgICMgICAgIyAgICAjICAjICAgICMgICMKKyAjICAgICAgICMgICAgIyAgIyAjICAjICAgICAjICAgICMgICAgIyAgIyAgICAjICAjCisgIyAgICAgICAjICAgICMgICMgICMgIyAgICAgIyAgICAjIyMjIyAgICMgICAgIyAgIworICMgICAgIyAgIyAgICAjICAjICAgIyMgICAgICMgICAgIyAgICMgICAjICAgICMgICMKKyAgIyMjIyAgICAjIyMjICAgIyAgICAjICAgICAjICAgICMgICAgIyAgICMjIyMgICAjIyMjIyMKKworCisgICAgICAgICAjIyMjIyAgICMgICAgICAgICAjIyAgICAjICAgICMgICMjIyMjIworICAgICAgICAgIyAgICAjICAjICAgICAgICAjICAjICAgIyMgICAjICAjCisgICAgICAgICAjICAgICMgICMgICAgICAgIyAgICAjICAjICMgICMgICMjIyMjCisgICAgICAgICAjIyMjIyAgICMgICAgICAgIyMjIyMjICAjICAjICMgICMKKyAgICAgICAgICMgICAgICAgIyAgICAgICAjICAgICMgICMgICAjIyAgIworICAgICAgICAgIyAgICAgICAjIyMjIyMgICMgICAgIyAgIyAgICAjICAjIyMjIyMKKworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKioKKyAqIEBpbmdyb3VwIEl4RXRoQWNjCisgKgorICogQGZuIGl4RXRoQWNjUG9ydEVuYWJsZShJeEV0aEFjY1BvcnRJZCBwb3J0SWQpCisgKgorICogQGJyaWVmIFRoaXMgZW5hYmxlcyBhbiBFdGhlcm5ldCB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cmVjb3ZlcnkKKyAqIGFuZCBzaG91bGQgbmV2ZXIgYmUgdXNlZCBmb3IgdGhyb3R0bGluZyB0cmFmZmljLgorICoKKyAqIEBsaSBSZWVudHJhbnQgICAgLSB5ZXMKKyAqIEBsaSBJU1IgQ2FsbGFibGUgLSBubworICoKKyAqIEBwcmUKKyAqCisgKiBAbm90ZSBDYWxsaW5nIGl4RXRoQWNjUG9ydERpc2FibGUgZm9sbG93ZWQgYnkgaXhFdGhBY2NQb3J0RW5hYmxlIGlzCisgKiBndWFyYW50ZWVkIHRvIHJlc3RvcmUgY29ycmVjdCBFdGhlcm5ldCBUeC9SeCBvcGVyYXRpb24uCisgKgorICogQHBhcmFtIHBvcnRJZCA6IElEIG9mIHRoZSBwb3J0IAorICoKKyAqIEByZXR1cm4gSXhFdGhBY2NTdGF0dXMKKyAqIEBsaSBAYSBJWF9FVEhfQUNDX1NVQ0NFU1MgOiBNQUMgY29yZSByZXNldAorICogQGxpIEBhIElYX0VUSF9BQ0NfRkFJTCA6IEludmFsaWQgcG9ydCBvciBFdGhlcm5ldCBzZXJ2aWNlIG5vdCBpbml0aWFsaXplZAorICoKKyAqIDxocj4KKyAqLworUFVCTElDIEl4RXRoQWNjU3RhdHVzIAoraXhFdGhBY2NQb3J0TWFjUmVzZXQoSXhFdGhBY2NQb3J0SWQgcG9ydElkKTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAjIyMjICAgICMjIyMjICAgICMjICAgICAjIyMjIyAgICAgIyAgICAgIyMjIyAgICAjIyMjIyAgICAgIyAgICAgIyMjIyAgICAjIyMjCisgIyAgICAgICAgICAjICAgICAjICAjICAgICAgIyAgICAgICAjICAgICMgICAgICAgICAgIyAgICAgICAjICAgICMgICAgIyAgIworICAjIyMjICAgICAgIyAgICAjICAgICMgICAgICMgICAgICAgIyAgICAgIyMjIyAgICAgICMgICAgICAgIyAgICAjICAgICAgICAjIyMjCisgICAgICAjICAgICAjICAgICMjIyMjIyAgICAgIyAgICAgICAjICAgICAgICAgIyAgICAgIyAgICAgICAjICAgICMgICAgICAgICAgICAjCisgIyAgICAjICAgICAjICAgICMgICAgIyAgICAgIyAgICAgICAjICAgICMgICAgIyAgICAgIyAgICAgICAjICAgICMgICAgIyAgIyAgICAjCisgICMjIyMgICAgICAjICAgICMgICAgIyAgICAgIyAgICAgICAjICAgICAjIyMjICAgICAgIyAgICAgICAjICAgICAjIyMjICAgICMjIyMKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKworLyoqCisgKgorICogQGJyaWVmIFRoaXMgc3RydWN0IGRlZmluZXMgdGhlIHN0YXRpc3RpY3MgcmV0dXJuZWQgYnkgdGhpcyBjb21wb25lbnQuCisgKgorICogVGhlIGNvbXBvbmVudCByZXR1cm5zIE1JQjIgRXRoT2JqIHZhcmlhYmxlcyB3aGljaCBhcmUgb2J0YWluZWQgZnJvbSB0aGUgCisgKiBoYXJkd2FyZSBvciBtYWludGFpbmVkIGJ5IHRoaXMgY29tcG9uZW50LiAKKyAqCisgKgorICovCit0eXBlZGVmIHN0cnVjdCAgIAoreworICAgIFVJTlQzMiBkb3QzU3RhdHNBbGlnbm1lbnRFcnJvcnM7ICAgICAgICAgICAgLyoqPCBsaW5rIGVycm9yIGNvdW50IChyeCkgKi8KKyAgICBVSU5UMzIgZG90M1N0YXRzRkNTRXJyb3JzOyAgICAgICAgICAgICAgICAgIC8qKjwgbGluayBlcnJvciBjb3VudCAocngpICovCisgICAgVUlOVDMyIGRvdDNTdGF0c0ludGVybmFsTWFjUmVjZWl2ZUVycm9yczsgICAvKio8IGxpbmsgZXJyb3IgY291bnQgKHJ4KSAqLworICAgIFVJTlQzMiBSeE92ZXJydW5EaXNjYXJkczsgICAgICAgICAgICAgICAgICAgLyoqPCBOUEU6IGRpc2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AorICogQGJyaWVmIEluaXRpYWxpemVzIHRoZSBldGhlcm5ldCBNQUMgc2V0dGluZ3MgCisgKiAKKyAqIEBsaSBSZWVudHJhbnQgICAgLSBubworICogQGxpIElTUiBDYWxsYWJsZSAtIG5vCisgKgorICogQHBhcmFtIHBvcnRJZCBAcmVmIEl4RXRoQWNjUG9ydElkIFtpbl0KKyAqCisgKiBAcmV0dXJuIEl4RXRoQWNjU3RhdHVzCisgKiBAbGkgQGEgSVhfRVRIX0FDQ19TVUNDRVNTCisgKiBAbGkgQGEgSVhfRVRIX0FDQ19JTlZBTElEX1BPUlQJOiAgcG9ydElkIGlzIGludmFsaWQuCisgKgorICogPGhyPgorICovCitQVUJMSUMgSXhFdGhBY2NTdGF0dXMgaXhFdGhBY2NNYWNJbml0KEl4RXRoQWNjUG9ydElkIHBvcnRJZCk7CisKKy8qKgorICogQGluZ3JvdXAgSXhFdGhBY2MKKyAqCisgKiBAZm4gaXhFdGhBY2NTdGF0c1Nob3coSXhFdGhBY2NQb3J0SWQgcG9ydElkKQorICoKKyAqCisgKiBAYnJpZWYgRGlzcGxheXMgYSBwb3J0cyBzdGF0aXN0aWNzIG9uIHRoZSBzdGFuZGFyZCBpbyBjb25zb2xlIHVzaW5nIHByaW50Zi4KKyAqCisgKiBAbGkgUmVlbnRyYW50ICAgIC0gbm8KKyAqIEBsaSBJU1IgQ2FsbGFibGUgLSBubworICoKKyAqIEBwcmUKKyAqCisgKiBAcGFyYW0gcG9ydElkIEByZWYgSXhFdGhBY2NQb3J0SWQgW2luXQorICoKKyAqIEByZXR1cm4gdm9pZAorICoKKyAqIDxocj4KKyAqLworUFVCTElDIHZvaWQgaXhFdGhBY2NTdGF0c1Nob3coSXhFdGhBY2NQb3J0SWQgcG9ydElkKTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKworICMgICAgIyAgICAgIyAgICAgICAjICAgICAgICAgICAgIyAgICAjICAjIyMjIyAgICAgICMgICAgICMjIyMKKyAjIyAgIyMgICAgICMgICAgICAgIyAgICAgICAgICAgICMjICAjIyAgIyAgICAjICAgICAjICAgICMgICAgIworICMgIyMgIyAgICAgIyAgICAgICAjICAgICAgICAgICAgIyAjIyAjICAjICAgICMgICAgICMgICAgIyAgICAjCisgIyAgICAjICAgICAjICAgICAgICMgICAgICAgICAgICAjICAgICMgICMgICAgIyAgICAgIyAgICAjICAgICMKKyAjICAgICMgICAgICMgICAgICAgIyAgICAgICAgICAgICMgICAgIyAgIyAgICAjICAgICAjICAgICMgICAgIworICMgICAgIyAgICAgIyAgICAgICAjICAgICAgICAgICAgIyAgICAjICAjIyMjIyAgICAgICMgICAgICMjIyMKKworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworCisvKioKKyAqIEBpbmdyb3VwIEl4RXRoQWNjCisgKgorICogQGZuIGl4RXRoQWNjTWlpUmVhZFJ0biAoVUlOVDggcGh5QWRkciwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICBVSU5UOCBwaHlSZWcsIAorCSAgICAgICAgICAgICAgICAgICBVSU5UMTYgKnZhbHVlKQorICoKKyAqCisgKiBAYnJpZWYgUmVhZHMgYSAxNiBiaXQgdmFsdWUgZnJvbSBhIFBIWQorICoKKyAqIFJlYWRzIGEgMTYtYml0IHdvcmQgZnJvbSBhIHJlZ2lzdGVyIG9mIGEgTUlJLWNvbXBsaWFudCBQSFkuIFJlYWRpbmcKKyAqIGlzIHBlcmZvcm1lZCB0aHJvdWdoIHRoZSBNSUkgbWFuYWdlbWVudCBpbnRlcmZhY2UuICBUaGlzIGZ1bmN0aW9uIHJldHVybnMKKyAqIHdoZW4gdGhlIHJlYWQgb3BlcmF0aW9uIGhhcyBzdWNjZXNzZnVsbHkgY29tcGxldGVkLCBvciB3aGVuIGEgdGltZW91dCBoYXMgZWxhcHNlZC4KKyAqCisg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cyBJWF9BVE1fSURMRV9DRUxMU19DT05OSUQsIHRoaXMgaW5kaWNhdGVzCisgICAgICAgICAgICAgICAgICogdGhhdCB0aGUgc3lzdGVtIHNob3VsZCB0cmFuc21pdCB0aGUgc3BlY2lmaWVkIG51bWJlcgorICAgICAgICAgICAgICAgICAqIG9mIGlkbGUgY2VsbHMuIFVua25vd24gY29ubklkcyByZXN1bHQgaW4gdGhlIHRyYW5zbWlzc2lvbgorICAgICAgICAgICAgICAgICAqIGlkbGUgY2VsbHMuCisgICAgICAgICAgICAgICAgICovCisgICAgdW5zaWduZWQgaW50IG51bWJlck9mQ2VsbHM7IC8qKjwgbnVtYmVyIG9mIGNlbGxzIHRvIHRyYW5zbWl0CisgICAgICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAgICAgKiBUaGUgbnVtYmVyIG9mIGNvbnRpZ3VvdXMgY2VsbHMgdG8gc2NoZWR1bGUgZnJvbSB0aGlzIFZDCisgICAgICAgICAgICAgICAgICogYXQgdGhpcyBwb2ludC4gVGhlIHZhbGlkIHJhbmdlIGlzIGZyb20gMSB0bworICAgICAgICAgICAgICAgICAqIEBhIElYX0FUTV9TQ0hFRFVMRVRBQkxFX01BWENFTExTX1BFUl9FTlRSWS4gVGhpcworICAgICAgICAgICAgICAgICAqIG51bWJlciBjYW4gc3dhcCBvdmVyIG1idWZzIGFuZCBwZHVzLiBPdmVyU2NoZHVsaW5nIHJlc3VsdHMKKyAgICAgICAgICAgICAgICAgKiBpbiB0aGUgdHJhbnNtaXNzaW9uIG9mIGlkbGUgY2VsbHMuCisgICAgICAgICAgICAgICAgICovCit9IEl4QXRtU2NoZWR1bGVUYWJsZUVudHJ5OworCisvKioKKyAqIEBicmllZiBUaGlzIHN0cnVjdHVyZSBkZWZpbmVzIGEgc2NoZWR1bGUgdGFibGUgd2hpY2ggZ2l2ZXMgZGV0YWlscworICogICAgICAgICBvbiB3aGljaCBkYXRhIChmcm9tIHdoaWNoIFZDcykgc2hvdWxkIGJlIHRyYW5zbWl0dGVkIGZvciBhCisgKiAgICAgICAgIGZvcnRoY29taW5nIHBlcmlvZCBvZiB0aW1lIGZvciBhIHBhcnRpY3VsYXIgcG9ydCBhbmQgdGhlCisgKiAgICAgICAgIG9yZGVyIGluIHdoaWNoIHRoYXQgZGF0YSBzaG91bGQgYmUgdHJhbnNtaXR0ZWQuCisgKgorICogIFRoZSBzY2hlZHVsZSB0YWJsZSBjb25zaXN0cyBvZiBhIHNlcmllcyBvZiBlbnRyaWVzIGVhY2ggb2Ygd2hpY2gKKyAqICB3aWxsIHNjaGVkdWxlIG9uZSBvciBtb3JlIGNlbGxzIGZyb20gYSBwYXJ0aWN1bGFyIHJlZ2lzdGVyZWQgVkMuCisgKiAgVGhlIHRvdGFsIG51bWJlciBvZiBjZWxscyBzY2hlZHVsZWQgYW5kIHRoZSB0b3RhbCBudW1iZXIgb2YKKyAqICBlbnRyaWVzIGluIHRoZSB0YWJsZSBhcmUgYWxzbyBpbmRpY2F0ZWQuCisgKgorICovCit0eXBlZGVmIHN0cnVjdAoreworICAgIHVuc2lnbmVkIHRhYmxlU2l6ZTsgICAgICAvKio8IE51bWJlciBvZiBlbnRyaWVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIEluZGljYXRlcyB0aGUgdG90YWwgbnVtYmVyIG9mCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqICAgZW50cmllcyBpbiB0aGUgdGFibGUuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgIHVuc2lnbmVkIHRvdGFsQ2VsbFNsb3RzOyAvKio8IE51bWJlciBvZiBjZWxscworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBJbmRpY2F0ZXMgdGhlIHRvdGFsIG51bWJlciBvZiBBVE0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogICBjZWxscyB3aGljaCBhcmUgc2NoZWR1bGVkIGJ5IGFsbCB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogICBlbnRyaWVzIGluIHRoZSB0YWJsZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgSXhBdG1TY2hlZHVsZVRhYmxlRW50cnkgKnRhYmxlOyAvKio8IFBvaW50ZXIgdG8gc2NoZWR1bGUgZW50cmllcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIFBvaW50ZXIgdG8gYW4gYXJyYXkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqICAgY29udGFpbmluZyB0YWJsZVNpemUgZW50cmllcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCit9IEl4QXRtU2NoZWR1bGVUYWJsZTsKKworI2VuZGlmIC8qIElYQVRNVFlQRVNfSCAqLworCisvKioKKyAqIEB9IGRlZmdyb3VwIEl4QXRtVHlwZXMKKyAqLworCisKZGlmZiAtLWdpdCBhL2NwdS9peHAvbnBlL2luY2x1ZGUvSXhBdG1kQWNjLmggYi9jcHUvaXhwL25wZS9pbmNsdWRlL0l4QXRtZEFjYy5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmFlN2IyNDMKLS0tIC9kZXYvbnVsbAorKysgYi9jcHUvaXhwL25wZS9pbmNsdWRlL0l4QXRtZEFjYy5oCkBAIC0wLDAgKzEsMTE5NCBAQAorCisvKioKKyAqIEBmaWxlICAgIEl4QXRtZEFjYy5oCisgKgorICogQGRhdGUgICAgMDctTm92LTIwMDEKKyAqCisgKiBAYnJpZWYgSXhBdG1kQWNjIFB1YmxpYyBBUEkKKyAqCisgKiBUaGlzIGZpbGUgY29udGFpbnMgdGhlIHB1YmxpYyBBUEkgb2YgSXhBdG1kQWNjLCByZWxhdGVkIHRvIHRoZQorICogZGF0YS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lhbGlzZWQsCisgKiAgICAgICAgICAgICBvciBzb21lIG90aGVyIGVycm9yIG9jY3VycyBkdXJpbmcgcHJvY2Vzc2luZy4KKyAqCisgKiBAbm90ZSAtIFVuc2NoZWR1bGVkIG1vZGUgaXMgbm90IHN1cHBvcnRlZCBpbiBpeHA0MjUgMS4wLiBUaGVyZWZvcmUsIHRoZQorICogICAgICAgZnVuY3Rpb24gQGEgaXhBdG1kQWNjUG9ydFR4U2NoZWR1bGVkTW9kZUVuYWJsZSgpIG5lZWQgdG8gYmUgY2FsbGVkCisgKiAgICAgICBmb3IgdGhpcyBwb3J0IGJlZm9yZSBhbnkgZXN0YWJsaXNoaW5nIGEgVHggQ29ubmVjdGlvbgorICovCitQVUJMSUMgSVhfU1RBVFVTIGl4QXRtZEFjY1R4VmNDb25uZWN0IChJeEF0bUxvZ2ljYWxQb3J0IHBvcnQsCisgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgaW50IHZwaSwKKyAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBpbnQgdmNpLAorICAgICAgICAgICAgICAgICAgICAgIEl4QXRtZEFjY0FhbFR5cGUgYWFsU2VydmljZVR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgSXhBdG1kQWNjVXNlcklkIHVzZXJJZCwKKyAgICAgICAgICAgICAgICAgICAgICBJeEF0bWRBY2NUeFZjQnVmZmVyUmV0dXJuQ2FsbGJhY2sgYnVmZmVyRnJlZUNhbGxiYWNrLAorICAgICAgICAgICAgICAgICAgICAgIEl4QXRtQ29ubklkICogY29ubklkUHRyKTsKKworLyoqCisgKgorICogQGluZ3JvdXAgSXhBdG1kQWNjQVBJCisgKgorICogQGZuIGl4QXRtZEFjY1R4VmNQZHVTdWJtaXQgKEl4QXRtQ29ubklkIGNvbm5JZCwKKyAgICAgICAgICAgICAgICAgICAgSVhfT1NBTF9NQlVGICogbWJ1ZlB0ciwKKyAgICAgICAgICAgICAgICAgICAgSXhBdG1kQWNjQ2xwU3Rhd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BUcmFuc21pdCBJbnRlcmZhY2UuIFRoZSBmb2xsb3dpbmcgZW5jb2RpbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBpcyB1c2VkIHRvIHNldCB0aGUgVXRvcGlhIFRyYW5zbWl0IGludGVyZmFjZSBhcyBBVE0gbWFzdGVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogb3IgUEhZIHNsYXZlOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIEBsaSAxIC0gUEhZCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogQGxpIDAgLSBBVE0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICB1bnNpZ25lZCBpbnQgdHhNb2RlOjE7ICAgICAgLyoqPCBbMjldIFV0b3BpYSBUcmFuc21pdCBNb2RlLiBUaGUgZm9sbG93aW5nIGVuY29kaW5nIGlzIHVzZWQKKyAgICAqICB0byBzZXQgdGhlIFV0b3BpYSBUcmFuc21pdCBtb2RlIHRvIFNQSFkgb3IgTVBIWToKKyAgICAqICBAbGkgMSAtIFNQSFkKKyAgICAqICBAbGkgMCAtIE1QSFkKKyAgICAqLworICAgIHVuc2lnbmVkIGludCB0eE9jdGV0OjE7ICAvKio8IFsyOF0gVXRvcGlhIFRyYW5zbWl0IGNlbGwgdHJhbnNmZXIgcHJvdG9jb2wuIFVzZWQgdG8gc2V0CisgICAgKiB0aGUgVXRvcGlhIGNlbGwgdHJhbnNmZXIgcHJvdG9jb2wgdG8gT2N0ZXQtbGV2ZWwgaGFuZHNoYWtpbmcuCisgICAgKiBOb3RlIHRoaXMgaXMgb25seSBhcHBsaWNhYmxlIGluIFNQSFkgbW9kZS4KKyAgICAqIEBsaSAxIC0gT2N0ZXQtaGFuZHNoYWtpbmcgZW5hYmxlZAorICAgICogQGxpIDAgLSBDZWxsLWhhbmRzaGFraW5nIGVuYWJsZWQKKyAgICAqLworICAgIHVuc2lnb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ICAgKiBAaW5ncm91cCBJeEF0bWRBY2NVdG9waWFDdHJsQVBJCisgICAgKiBAc3RydWN0IFV0VHhDZWxsQ29uZGl0aW9uU3RhdHVzXworICAgICogQGJyaWVmIFV0b3BpYSBUeCBTdGF0dXMgUmVnaXN0ZXIKKyAgICAqLworICAgIHN0cnVjdCBVdFR4Q2VsbENvbmRpdGlvblN0YXR1c18KKyAgICB7CisKKyAgICB1bnNpZ25lZCBpbnQgcmVzZXJ2ZWRfMToyOyAgIC8qKjwgWzMxOjMwXSBUaGVzZSBiaXRzIGFyZSBhbHdheXMgMCAqLworICAgIHVuc2lnbmVkIGludCB0eEZJRk8yVW5kZXJmbG93OjE7IC8qKjwgWzI5XSBUaGlzIGJpdCBpcyBzZXQgaWYgNjQtYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogVHJhbnNtaXQgRklGTzIgaW5kaWNhdGVzIGEgRklGTyB1bmRlcmZsb3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGVycm9yIGNvbmRpdGlvbi4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgIHVuc2lnbmVkIGludCB0eEZJRk8xVW5kZXJmbG93OjE7IC8qKjwgWzI4XSBUaGlzIGJpdCBpcyBzZXQgaWYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIDY0LWJ5dGUgVHJhbnNtaXQgRklGTzEgaW5kaWNhdGVzIGEgRklGTworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogdW5kZXJmbG93IGVycm9yIGNvbmRpdGlvbi4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgIHVuc2lnbmVkIGludCB0eEZJRk8yT3ZlcmZsb3c6MTsgIC8qKjwgWzI3XSBUaGlzIGJpdCBpcyBzZXQgaWYgNjQtYnl0ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogVHJhbnNtaXQgRklGTzIgaW5kaWNhdGVzIGEgRklGTyBvdmVyZmxvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogZXJyb3IgY29uZGl0aW9uLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgdW5zaWduZWQgaW50IHR4RklGTzFPdmVyZmxvdzoxOyAvKio8IFsyNl0gVGhpcyBiaXQgaXMgc2V0IGlmIDY0LWJ5dGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogVHJhbnNtaXQgRklGTzEgaW5kaWNhdGVzIGEgRklGTyBvdmVyZmxvdworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBlcnJvciBjb25kaXRpb24uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgIHVuc2lnbmVkIGludCB0eElkbGVDZWxsQ291bnRPdnI6MTsgLyoqPCBbMjVdIFRoaXMgYml0IGlzIHNldCBpZiB0aGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogVHhJZGxlQ2VsbENvdW50IHJlZ2lzdGVyIG92ZXJmbG93cy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgdW5zaWduZWQgaW50IHR4Q2VsbENvdW50T3ZyOjE7IC8qKjwgWzI0XSBUaGlzIGJpdCBpcyBzZXQgaWYgdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogVHhDZWxsQ291bnQgcmVnaXN0ZXIgb3ZlcmZsb3dzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgdW5zaWduZWQgaW50IHJlc2VydmVkXzI6MjQ7ICAgIC8qKjwgWzIzOjBdIFRoZXNlIGJpdHMgYXJlIGFsd2F5cyAwICovCisgICAgfSB1dFR4Q2VsbENvbmRpdGlvblN0YXR1czsgICAgLyoqPCBUeCBjZWxscyBjb25kaXRpb24gc3RhdHVzICovCisKKyAgICB1bnNpZ25lZCBpbnQgdXRSeENlbGxDb3VudDsgLyoqPCBjb3VudCBvZiBjZWxsIHJlY2VpdmVkICovCisgICAgdW5zaWduZWQgaW50IHV0UnhJZGxlQ2VsbENvdW50OyAgICAvKio8IGNvdW50IG9mIGlkbGUgY2VsbCByZWNlaXZlZCAqLworICAgIHVuc2lnbmVkIGludCB1dFJ4SW52YWxpZEhFQ291bnQ7ICAgICAvKio8IGNvdW50IG9mIGludmFsaWQgY2VsbAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogcmVjZWl2ZWQgYmVjYXVzZSBvZiBIRUMgZXJyb3JzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICB1bnNpZ25lZCBpbnQgdXRSeEludmFsaWRQYXJDb3VudDsgIC8qKjwgY291bnQgb2YgaW52YWxpZCBjZWxsIHJlY2VpdmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBiZWNhdXNlIG9mIHBhcml0eSBlcnJvcnMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgIHVuc2lnbmVkIGludCB1dFJ4SW52YWxpZFNpemVDb3VudDsgIC8qKjwgY291bnQgb2YgaW52YWxpZCBjZWxsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiByZWNlaXZlZCBiZWNhdXNlIG9mIGNlbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNpemUgZXJyb3JzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKworICAgIC8qKgorICAgICogQGluZ3JvdXAgSXhBdG1kQWNjVXRvcGlhQ3RybEFQSQorICAgICogQHN0cnVjdCBVdFJ4Q2VsbENvbmRpdGlvblN0YXR1c18KKyAgICAqIEBicmllZiBVdG9waWEgUnggU3RhdHVzIFJlZ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RoaXMgYml0IGlzIHNldCBpZiA2NC1ieXRlIFJlY2VpdmUgRklGTzIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBpbmRpY2F0ZXMgYSBGSUZPIHVuZGVyZmxvdyBlcnJvciBjb25kaXRpb24uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgdW5zaWduZWQgaW50IHJ4RklGTzFVbmRlcmZsb3c6MTsgIC8qKjwgWzE4XSBUaGlzIGJpdCBpcyBzZXQgaWYgNjQtYnl0ZSBSZWNlaXZlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogRklGTzEgaW5kaWNhdGVzIGEgRklGTyB1bmRlcmZsb3cgZXJyb3IgY29uZGl0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuICovCisgICAgdW5zaWduZWQgaW50IHJ4RklGTzJPdmVyZmxvdzoxOyAgICAvKio8IFsxN10gVGhpcyBiaXQgaXMgc2V0IGlmIDY0LWJ5dGUgUmVjZWl2ZSBGSUZPMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBpbmRpY2F0ZXMgYSBGSUZPIG92ZXJmbG93IGVycm9yIGNvbmRpdGlvbi4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgIHVuc2lnbmVkIGludCByeEZJRk8xT3ZlcmZsb3c6MTsgICAgLyoqPCBbMTZdIFRoaXMgYml0IGlzIHNldCBpZiA2NC1ieXRlIFJlY2VpdmUgRklGTzEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogaW5kaWNhdGVzIGEgRklGTyBvdmVyZmxvdyBlcnJvciBjb25kaXRpb24uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgIHVuc2lnbmVkIGludCByZXNlcnZlZF8zOjE2OyAgICAgIC8qKjwgWzE1OjBdIFRoZXNlIGJpdHMgY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yAgICMgICMgICAgICAjICAgICAjICAjICAgICAgICAgICAjICAgICMgICAjICAjICAgICAgIyAgICAjICAgICMKKyAjICAgICMgICMgICAgIyAgICAgIyAgICAjICAgICMgICAgICAgICAgIyAgICAjICAjICAgICMgICAgICMgICAgIyMjIyMjCisgIyAgICAjICAjIyMjIyMgICAgICMgICAgIyMjIyMjICAgICAgICAgICMjIyMjICAgIyMjIyMjICAgICAjICAgICMgICAgIworICMgICAgIyAgIyAgICAjICAgICAjICAgICMgICAgIyAgICAgICAgICAjICAgICAgICMgICAgIyAgICAgIyAgICAjICAgICMKKyAjIyMjIyAgICMgICAgIyAgICAgIyAgICAjICAgICMgICAgICAgICAgIyAgICAgICAjICAgICMgICAgICMgICAgIyAgICAjCisKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKworLyoqCisgKiBAaW5ncm91cCBJeEV0aEFjYworICoKKyAqIEBmbiBpeEV0aEFjY1BvcnRUeEZyYW1lU3VibWl0KCAKKyAgICBJeEV0aEFjY1BvcnRJZCBwb3J0SWQsCisgICAgSVhfT1NBTF9NQlVGICpidWZmZXIsIAorICAgIEl4RXRoQWNjVHhQcmlvcml0eSBwcmlvcml0eSkKKyAqIAorICogQGJyaWVmIFRoaXMgZnVuY3Rpb24gc2hhbGwgYmUgdXNlZCB0byBzdWJtaXQgTUJVRnMgYnVmZmVycyBmb3IgdHJhbnNtaXNzaW9uIG9uIGEgcGFydGljdWxhciBNQUMgZGV2aWNlLiAKKyAqCisgKiBXaGVuIHRoZSBmcmFtZSBpcyB0cmFuc21pdHRlZCwgdGhlIGJ1ZmZlciBzaGFsbCBiZSByZXR1cm5lZCB0aHJ1IHRoZSAKKyAqIGNhbGxiYWNrIEBhIEl4RXRoQWNjUG9ydFR4RG9uZUNhbGxiYWNrLgorICoKKyAqIEluIGNhc2Ugb2Ygb3Zlci1zdWJtaXR0aW5nLCB0aGUgb3JkZX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orICogPGhyPgorICovCitQVUJMSUMgSXhFdGhBY2NTdGF0dXMKK2l4RXRoQWNjUG9ydFJ4RnJlZVJlcGxlbmlzaCggSXhFdGhBY2NQb3J0SWQgcG9ydElkLCBJWF9PU0FMX01CVUYgKmJ1ZmZlcik7CisKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisKKyAgIyMjIyAgICAjIyMjICAgIyAgICAjICAgIyMjIyMgICMjIyMjICAgICMjIyMgICAjCisgIyAgICAjICAjICAgICMgICMjICAgIyAgICAgIyAgICAjICAgICMgICMgICAgIyAgIworICMgICAgICAgIyAgICAjICAjICMgICMgICAgICMgICAgIyAgICAjICAjICAgICMgICMKKyAjICAgICAgICMgICAgIyAgIyAgIyAjICAgICAjICAgICMjIyMjICAgIyAgICAjICAjCisgIyAgICAjICAjICAgICMgICMgICAjIyAgICAgIyAgICAjICAgIyAgICMgICAgIyAgIworICAjIyMjICAgICMjIyMgICAjICAgICMgICAgICMgICAgIyAgICAjICAgIyMjIyAgICMjIyMjIworCisKKyAgICAgICAgICMjIyMjICAgIyAgICAgICAgICMjICAgICMgICAgIyAgIyMjIyMjCisgICAgICAgICAjICAgICMgICMgICAgICAgICMgICMgICAjIyAgICMgICMKKyAgICAgICAgICMgICAgIyAgIyAgICAgICAjICAgICMgICMgIyAgIyAgIyMjIyMKKyAgICAgICAgICMjIyMjICAgIyAgICAgICAjIyMjIyMgICMgICMgIyAgIworICAgICAgICAgIyAgICAgICAjICAgICAgICMgICAgIyAgIyAgICMjICAjCisgICAgICAgICAjICAgICAgICMjIyMjIyAgIyAgICAjICAjICAgICMgICMjIyMjIworCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qKgorICogQGluZ3JvdXAgSXhFdGhBY2MKKyAqCisgKiBAZm4gaXhFdGhBY2NQb3J0RW5hYmxlKEl4RXRoQWNjU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2FnZSBzY2VuYXJpbyBmb3IgaGFyZHdhcmUgZmFpbHVyZSByZWNvdmVyeQorICogYW5kIHNob3VsZCBuZXZlciBiZSB1c2VkIGZvciB0aHJvdHRsaW5nIHRyYWZmaWMuCisgKgorICogQGxpIFJlZW50cmFudCAgICAtIHllcworICogQGxpIElTUiBDYWxsYWJsZSAtIG5vCisgKgorICogQHByZQorICoKKyAqIEBub3RlIENhbGxpbmcgaXhFdGhBY2NQb3J0RGlzYWJsZSBmb2xsb3dlZCBieSBpeEV0aEFjY1BvcnRFbmFibGUgaXMKKyAqIGd1YXJhbnRlZWQgdG8gcmVzdG9yZSBjb3JyZWN0IEV0aGVybmV0IFR4L1J4IG9wZXJhdGlvbi4KKyAqCisgKiBAcGFyYW0gcG9ydElkIDogSUQgb2YgdGhlIHBvcnQgCisgKgorICogQHJldHVybiBJeEV0aEFjY1N0YXR1cworICogQGxpIEBhIElYX0VUSF9BQ0NfU1VDQ0VTUyA6IE1BQyBjb3JlIHJlc2V0CisgKiBAbGkgQGEgSVhfRVRIX0FDQ19GQUlMIDogSW52YWxpZCBwb3J0IG9yIEV0aGVybmV0IHNlcnZpY2Ugbm90IGluaXRpYWxpemVkCisgKgorICogPGhyPgorICovCitQVUJMSUMgSXhFdGhBY2NTdGF0dXMgCitpeEV0aEFjY1BvcnRNYWNSZXNldChJeEV0aEFjY1BvcnRJZCBwb3J0SWQpOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgICMjIyMgICAgIyMjIyMgICAgIyMgICAgICMjIyMjICAgICAjICAgICAjIyMjICAgICMjIyMjICAgICAjICAgICAjIyMjICAgICMjIyMKKyAjICAgICAgICAgICMgICAgICMgICMgICAgICAjICAgICAgICMgICAgIyAgICAgICAgICAjICAgICAgICMgICAgIyAgICAjICAjCisgICMjIyMgICAgICAjICAgICMgICAgIyAgICAgIyAgICAgICAjICAgICAjIyMjICAgICAgIyAgICAgICAjICAgICMgICAgICAgICMjIyMKKyAgICAgICMgICAgICMgICAgIyMjIyMjICAgICAjICAgICAgICMgICAgICAgICAjICAgICAjICAgICAgICMgICAgIyAgICAgICAgICAgICMKKyAjICAgICMgICAgICMgICAgIyAgICAjICAgICAjICAgICAgICMgICAgIyAgICAjICAgICAjICAgICAgICMgICAgIyAgICAjICAjICAgICMKKyAgIyMjIyAgICAgICMgICAgIyAgICAjICAgICAjICAgICAgICMgICAgICMjIyMgICAgICAjICAgICAgICMgICAgICMjIyMgICAgIyMjIworKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworCisvKioKKyAqCisgKiBAYnJpZWYgVGhpcyBzdHJ1Y3QgZGVmaW5lcyB0aGUgc3RhdGlzdGljcyByZXR1cm5lZCBieSB0aGlzIGNvbXBvbmVudC4KKyAqCisgKiBUaGUgY29tcG9uZW50IHJldHVybnMgTUlCMiBFdGhPYmogdmFyaWFibGVzIHdoaWNoIGFyZSBvYnRhaW5lZCBmcm9tIHRoZSAKKyAqIGhhcmR3YXJlIG9yIG1haW50YWluZWQgYnkgdGhpcyBjb21wb25lbnQuIAorICoKKyAqCisgKi8KK3R5cGVkZWYgc3RydWN0ICAgCit7CisgICAgVUlOVDMyIGRvdDNTdGF0c0FsaWdubWVudEVycm9yczsgICAgICAgICAgICAvKio8IGxpbmsgZXJyb3IgY291bnQgKHJ4KSAqLworICAgIFVJTlQzMiBkb3QzU3RhdHNGQ1NFcnJvcnM7ICAgICAgICAgICAgICAgICAgLyoqPCBsaW5rIGVycm9yIGNvdW50IChyeCkgKi8KKyAgICBVSU5UMzIgZG90M1N0YXRzSW50ZXJuYWxNYWNSZWNlaXZlRXJyb3JzOyAgIC8qKjwgbGluayBlcnJvciBjb3VudCAocngpICovCisgICAgVUlOVDMyIFJ4T3ZlcnJ1bkRpc2NhcmRzOyAgICAgICAgICAgIC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RTogZGlzY2FyZGVkIGZyYW1lcyBjb3VudCAocngpICovCisgICAgVUlOVDMyIGRvdDNTdGF0c1NpbmdsZUNvbGxpc2lvbkZyYW1lczsgICAgICAvKio8IGxpbmsgZXJyb3IgY291bnQgKHR4KSAqLworICAgIFVJTlQzMiBkb3QzU3RhdHNNdWx0aXBsZUNvbGxpc2lvbkZyYW1lczsgICAgLyoqPCBsaW5rIGVycm9yIGNvdW50ICh0eCkgKi8KKyAgICBVSU5UMzIgZG90M1N0YXRzRGVmZXJyZWRUcmFuc21pc3Npb25zOyAgICAgIC8qKjwgbGluayBlcnJvciBjb3VudCAodHgpICovCisgICAgVUlOVDMyIGRvdDNTdGF0c0xhdGVDb2xsaXNpb25zOyAgICAgICAgICAgICAvKio8IGxpbmsgZXJyb3IgY291bnQgKHR4KSAqLworICAgIFVJTlQzMiBkb3QzU3RhdHNFeGNlc3NpdmVDb2xsc2lvbnM7ICAgICAgICAgLyoqPCBsaW5rIGVycm9yIGNvdW50ICh0eCkgKi8KKyAgICBVSU5UMzIgZG90M1N0YXRzSW50ZXJuYWxNYWNUcmFuc21pdEVycm9yczsgIC8qKjwgbGluayBlcnJvciBjb3VudCAodHgpICovCisgICAgVUlOVDMyIGRvdDNTdGF0c0NhcnJpZXJTZW5zZUVycm9yczsgICAgICAgICAvKio8IGxpbmsgZXJyb3IgY291bnQgKHR4KSAqLworICAgIFVJTlQzMiBUeExhcmdlRnJhbWVEaXNjYXJkczsgICAgICAgICAgICAgICAgLyoqPCBOUEU6IGRpc2NhcmRlZCBmcmFtZXMgY291bnQgKHR4KSAqLworICAgIFVJTlQzMiBUeFZMQU5JZEZpbHRlckRpc2NhcmRzOyAgICAgICAgICAgICAgLyoqPCBOUEU6IGRpc2NhcmRlZCBmcmFtZXMgY291bnQgKHR4KSAqLworCit9SXhFdGhFdGhPYmpTdGF0czsKKworLyoqCisgKiBAaW5ncm91cCBJeEV0aEFjYworICoKKyAqIEBmbiBpeEV0aEFjY01pYklJU3RhdHN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CisgKiBAYnJpZWYgSW5pdGlhbGl6ZXMgdGhlIGV0aGVybmV0IE1BQyBzZXR0aW5ncyAKKyAqIAorICogQGxpIFJlZW50cmFudCAgICAtIG5vCisgKiBAbGkgSVNSIENhbGxhYmxlIC0gbm8KKyAqCisgKiBAcGFyYW0gcG9ydElkIEByZWYgSXhFdGhBY2NQb3J0SWQgW2luXQorICoKKyAqIEByZXR1cm4gSXhFdGhBY2NTdGF0dXMKKyAqIEBsaSBAYSBJWF9FVEhfQUNDX1NVQ0NFU1MKKyAqIEBsaSBAYSBJWF9FVEhfQUNDX0lOVkFMSURfUE9SVAk6ICBwb3J0SWQgaXMgaW52YWxpZC4KKyAqCisgKiA8aHI+CisgKi8KK1BVQkxJQyBJeEV0aEFjY1N0YXR1cyBpeEV0aEFjY01hY0luaXQoSXhFdGhBY2NQb3J0SWQgcG9ydElkKTsKKworLyoqCisgKiBAaW5ncm91cCBJeEV0aEFjYworICoKKyAqIEBmbiBpeEV0aEFjY1N0YXRzU2hvdyhJeEV0aEFjY1BvcnRJZCBwb3J0SWQpCisgKgorICoKKyAqIEBicmllZiBEaXNwbGF5cyBhIHBvcnRzIHN0YXRpc3RpY3Mgb24gdGhlIHN0YW5kYXJkIGlvIGNvbnNvbGUgdXNpbmcgcHJpbnRmLgorICoKKyAqIEBsaSBSZWVudHJhbnQgICAgLSBubworICogQGxpIElTUiBDYWxsYWJsZSAtIG5vCisgKgorICogQHByZQorICoKKyAqIEBwYXJhbSBwb3J0SWQgQHJlZiBJeEV0aEFjY1BvcnRJZCBbaW5dCisgKgorICogQHJldHVybiB2b2lkCisgKgorICogPGhyPgorICovCitQVUJMSUMgdm9pZCBpeEV0aEFjY1N0YXRzU2hvdyhJeEV0aEFjY1BvcnRJZCBwb3J0SWQpOworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorCisgIyAgICAjICAgICAjICAgICAgICMgICAgICAgICAgICAjICAgICMgICMjIyMjICAgICAgIyAgICAgIyMjIworICMjICAjIyAgICAgIyAgICAgICAjICAgICAgICAgICAgIyMgICMjICAjICAgICMgICAgICMgICAgIyAgICAjCisgIyAjIyAjICAgICAjICAgICAgICMgICAgICAgICAgICAjICMjICMgICMgICAgIyAgICAgIyAgICAjICAgICMKKyAjICAgICMgICAgICMgICAgICAgIyAgICAgICAgICAgICMgICAgIyAgIyAgICAjICAgICAjICAgICMgICAgIworICMgICAgIyAgICAgIyAgICAgICAjICAgICAgICAgICAgIyAgICAjICAjICAgICMgICAgICMgICAgIyAgICAjCisgIyAgICAjICAgICAjICAgICAgICMgICAgICAgICAgICAjICAgICMgICMjIyMjICAgICAgIyAgICAgIyMjIworCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisKKy8qKgorICogQGluZ3JvdXAgSXhFdGhBY2MKKyAqCisgKiBAZm4gaXhFdGhBY2NNaWlSZWFkUnRuIChVSU5UOCBwaHlBZGRyLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIFVJTlQ4IHBoeVJlZywgCisJICAgICAgICAgICAgICAgICAgIFVJTlQxNiAqdmFsdWUpCisgKgorICoKKyAqIEBicmllZiBSZWFkcyBhIDE2IGJpdCB2YWx1ZSBmcm9tIGEgUEhZCisgKgorICogUmVhZHMgYSAxNi1iaXQgd29yZCBmcm9tIGEgcmVnaXN0ZXIgb2YgYSBNSUktY29tcGxpYW50IFBIWS4gUmVhZGluZworICogaXMgcGVyZm9ybWVkIHRocm91Z2ggdGhlIE1JSSBtYW5hZ2VtZW50IGludGVyZmFjZS4gIFRoaXMgZnVuY3Rpb24gcmV0dXJucworICogd2hlbiB0aGUgcmVhZCBvcGVyYXRpb24gaGFzIHN1Y2Nlc3NmdWxseSBjb21wbGV0ZWQsIG9yIHdoZW4gYSB0aW1lb3V0IGhhcyBlbGFwc2VkLgorICoKKyAqIEBsaSBS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AgIDx0cj48dGQ+IE1BQyBhZGRyZXNzIDx0ZD4gc3RhdGljL2R5bmFtaWMgdHlwZSA8dGQ+IGFnZSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogICA8L3RhYmxlPiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgIElYX0VUSF9EQl9GSUxURVJJTkdfVkxBTl9SRUNPUkQgICA9IDB4MDIsIC8qKjwgPHRhYmxlPjxjYXB0aW9uPiBWTEFOLWVuYWJsZWQgZmlsdGVyaW5nIHJlY29yZCA8L2NhcHRpb24+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqICAgICAgPHRyPjx0ZD4gTUFDIGFkZHJlc3MgPHRkPiBzdGF0aWMvZHluYW1pYyB0eXBlIDx0ZD4gYWdlIDx0ZD4gODAyLjFRIHRhZyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogICA8L3RhYmxlPiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgIElYX0VUSF9EQl9XSUZJX1JFQ09SRCAgICAgICAgICAgICA9IDB4MDQsIC8qKjwgPHRhYmxlPjxjYXB0aW9uPiBXaUZpIGhlYWRlciBjb252ZXJzaW9uIHJlY29yZCA8L2NhcHRpb24+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqICAgICAgPHRyPjx0ZD4gTUFDIGFkZHJlc3MgPHRkPiBvcHRpb25hbCBnYXRld2F5IE1BQyBhZGRyZXNzIDx0ZD4gCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqICAgPC90YWJsZT4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgIElYX0VUSF9EQl9GSVJFV0FMTF9SRUNPUkQgICAgICAgICA9IDB4MDgsI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JfRklMVEVSSU5HX1JFQ09SRCAgICAgIDx0YWJsZT48Y2FwdGlvbj4gRmlsdGVyaW5nIHJlY29yZCA8L2NhcHRpb24+CisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRyPjx0ZD4gTUFDIGFkZHJlc3MgPHRkPiBzdGF0aWMvZHluYW1pYyB0eXBlIDx0ZD4gYWdlIDwvdHI+CisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdGFibGU+IAorICoKKyAqICAgIC0gSVhfRVRIX0RCX0ZJTFRFUklOR19WTEFOX1JFQ09SRCA8dGFibGU+PGNhcHRpb24+IFZMQU4tZW5hYmxlZCBmaWx0ZXJpbmcgcmVjb3JkIDwvY2FwdGlvbj4KKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dHI+PHRkPiBNQUMgYWRkcmVzcyA8dGQ+IHN0YXRpYy9keW5hbWljIHR5cGUgPHRkPiBhZ2UgPHRkPiA4MDIuMVEgdGFnIDwvdHI+CisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdGFibGU+IAorICoKKyAqICAgIC0gSVhfRVRIX0RCX1dJRklfUkVDT1JEICAgICAgICAgICA8dGFibGU+PGNhcHRpb24+IFdpRmkgaGVhZGVyIGNvbnZlcnNpb24gcmVjb3JkIDwvY2FwdGlvbj4KKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRyPjx0ZD4gTUFDIGFkZHJlc3MgPHRkPiBvcHRpb25hbCBnYXRld2F5IE1BQyBhZGRyZXNzIDx0ZD4gPC90cj4KKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90YWJsZT4KKyAqCisgKiAgICAtIElYX0VUSF9EQl9GSVJFV0FMTF9SRUNPUkQgICAgICAgPHRhYmxlPjxjYXB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0gTUFYX0xPQ0tTKSBcCisgICAgICAgIHsgXAorICAgICAgICAgICAgRVJST1JfTE9HKCJFdGhlcm5ldCBEQjogbWF4aW11bSBudW1iZXIgb2YgZWxlbWVudHMgaW4gYSBsb2NrIHN0YWNrIGhhcyBiZWVuIGV4Y2VlZGVkIG9uIHB1c2gsIGhlYXZ5IGNoYWluaW5nP1xuIik7IFwKKyAgICAgICAgICAgIFVOUk9MTF9TVEFDSyhzdGFjayk7IFwKKyAgICAgICAgICAgIFwKKyAgICAgICAgICAgIHJldHVybiBJWF9FVEhfREJfTk9NRU07IFwKKyAgICAgICAgfSBcCisgICAgICAgIFwKKyAgICAgICAgaWYgKGl4T3NhbEZhc3RNdXRleFRyeUxvY2sobG9jaykgPT0gSVhfU1VDQ0VTUykgXAorICAgICAgICB7IFwKKyAgICAgICAgICAgIChzdGFjayktPmxvY2tzWyhzdGFjayktPnN0YWNrUG9pbnRlcisrXSA9IChsb2NrKTsgXAorICAgICAgICB9IFwKKyAgICAgICAgZWxzZSBcCisgICAgICAgIHsgXAorICAgICAgICAgICAgVU5ST0xMX1NUQUNLKHN0YWNrKTsgXAorICAgICAgICAgICAgXAorICAgICAgICAgICAgcmV0dXJuIElYX0VUSF9EQl9CVVNZOyBcCisgICAgICAgIH0gXAorICAgIH0KKworI2RlZmluZSBQT1BfTE9DSyhzdGFjaykgXAorICAgIHsgXAorICAgICAgICBpeE9zYWxGYXN0TXV0ZXhVbmxvY2soKHN0YWNrKS0+bG9ja3NbLS0oc3RhY2spLT5zdGFja1BvaW50ZXJdKTsgXAorICAgIH0KKworI2RlZmluZSBVTlJPTExfU1RBQ0soc3RhY2spIFwKKyAgICB7IFwKKyAgICAgICAgd2hpbGUgKChzdGFjayktPnN0YWNrUG9pbnRlciA+IChzdGFjayktPmJhc2VQb2ludGVyKSBcCisgICAgICAgIHsgXAorICAgICAgICAgICAgUE9QX0xPQ0soc3RhY2spOyBcCisgICAgICAgIH0gXAorICAgIH0KKworI2RlZmluZSBTS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DSCBEQU1BR0UuCisgKiAKKyAqIEBwYXIKKyAqIC0tIEVuZCBvZiBDb3B5cmlnaHQgTm90aWNlIC0tCisgKi8KKworI2luY2x1ZGUgPEl4T3NhbC5oPgorCisjaWZkZWYgSVhfVU5JVF9URVNUCisjZGVmaW5lIE5VTExfUFJJTlRfUk9VVElORShmb3JtYXQsIGFyZy4uLikgLyogbm90aGluZyAqLworI2Vsc2UKKyNkZWZpbmUgTlVMTF9QUklOVF9ST1VUSU5FIGlmKDApIHByaW50ZgorI2VuZGlmCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICAgICAgICAgICAgICBHbG9iYWxzICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKiBzYWZlIHRvIHBlcm1hbmVudGx5IGxlYXZlIHRoZXNlIG9uICovCisjZGVmaW5lIEhBU19FUlJPUl9MT0cKKyNkZWZpbmUgSEFTX0VSUk9SX0lSUV9MT0cKKyNkZWZpbmUgSEFTX1dBUk5JTkdfTE9HCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICAgICAgICAgICBMb2cgQ29uZmlndXJhdGlvbiAgICAgICAgICAgICAgICAgICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qIGRlYnVnIG91dHB1dCBjYW4gYmUgdHVybmVkIG9uIHVubGVzcyBzcGVjaWZpY2FsbHkKKyAgIGRlY2xhcmVkIGFzIGEgbm9uLWRlYnVnIGJ1aWxkICovCisjaWZuZGVmIE5ERUJVRworCisjdW5kZWYgSEFTX0VWRU5UU19UUkFDRQorI3VuZGVmIEhBU19FVkVOVFNfVkVSQk9TRV9UUkFDRQorCisjdW5kZWYgSEFTX1NVUFBPUlRfVFJBQ0UKKyN1bmRlZiBIQVNfU1VQUE9SVF9WRVJCT1NFX1RSQUNFCisKKyN1bmRlZiBIQVNfTlBFX1RSQUNFCisjdW5kZWYgSEFTX05QRV9WRVJCT1NFX1RSQUNFCisjdW5kZWYgSEFTX0RVTVBfTlBFX1RSRUUKKworI3VuZGVmIEhBU19VUERBVEVfVFJBQ0UKKyN1bmRlZiBIQVNfVVBEQVRFX1ZFUkJPU0VfVFJBQ0UKKworI2VuZGlmIC8qIE5ERUJVRyAqLworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICAgICAgICAgICAgICBMb2cgTWFjcm9zICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qKioqKioqKioqKioqKiBHbG9iYWxzICoqKioqKioqKioqKioqKioqKi8KKworI2lmZGVmIEhBU19FUlJPUl9MT0cKKworICAgICNkZWZpbmUgRVJST1JfTE9HIHByaW50ZgorCisjZWxzZQorCisgICAgI2RlZmluZSBFUlJPUl9MT0cgTlVMTF9QUklOVF9ST1VUSU5FCisKKyNlbmRpZgorCisjaWZkZWYgSEFTX0VSUk9SX0lSUV9MT0cKKworICAgICNkZWZpbmUgRVJST1JfSVJRX0xPRyhmb3JtYXQsIGFyZzEsIGFyZzIsIGFyZzMsIGFyZzQsIGFyZzUsIGFyZzYpIGl4T3NhbExvZyhJWF9PU0FMX0xPR19MVkxfRVJST1IsIElYX09TQUxfTE9HX0RFVl9TVERPVVQsIGZvcm1hdCwgYXJnMSwgYXJnMiwgYXJnMywgYXJnNCwgYXJnNSwgYXJnNikKKworI2Vsc2UKKworICAgICNkZWZpbmUgRVJST1JfSVJRX0xPRyhmb3JtYXQsIGFyZzEsIGFyZzIsIGFyZzMsIGFyZzQsIGFyZzUsIGFyZzYpIC8qIG5vdGhpbmcgKi8KKworI2VuZGlmCisKKyNpZmRlZiBIQVNfV0F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ICAgICAweDA5LCAgICAgICAgICAgICAgICAgICAgICAzLCAgICAgICAgICAgICAgICAgICAgMiB9LCAvKiBOUEUgQSBpbWFnZSBJRCAwLjkuMC4wICovCisgICAgeyAgICAgICAgICAgIDB4ODAsICAgICAgICAgICAgICAgICAgICAgIDgsICAgICAgICAgICAgICAgICAgICAzIH0sIC8qIE5QRSBBIGltYWdlIElEIDEwLjgwLjAyLjAgKi8KKyAgICB7ICAgICAgICAgICAgMHg4MSwgICAgICAgICAgICAgICAgICAgICAgOCwgICAgICAgICAgICAgICAgICAgIDMgfSwgLyogTlBFIEEgaW1hZ2UgSUQgMTAuODEuMDIuMCAqLworICAgIHsgICAgICAgICAgICAweDgyLCAgICAgICAgICAgICAgICAgICAgICA4LCAgICAgICAgICAgICAgICAgICAgMyB9ICAvKiBOUEUgQSBpbWFnZSBJRCAxMC44Mi4wMi4wICovCit9OworCisvKioKKyAqIEBicmllZiBJRUVFIDgwMi4xUSByZWNvbW1lbmRlZCBRb1MgUHJpb3JpdHkgPT4gdHJhZmZpYyBjbGFzcyBtYXBzCisgKgorICogQHZlcmJhdGltCisgICAgICAgICAgICAgICAgICAgIE51bWJlciBvZiBhdmFpbGFibGUgdHJhZmZpYyBjbGFzc2VzDQorICAgICAgICAgICAgICAgICAgICAxIDIgMyA0IDUgNiA3IDgNCisgICAgUW9TIFByaW9yaXR5DQorICAgICAgICAwICAgICAgICAgICAwIDAgMCAxIDEgMSAxIDINCisgICAgICAgIDEgICAgICAgICAgIDAgMCAwIDAgMCAwIDAgMA0KKyAgICAgICAgMiAgICAgICAgICAgMCAwIDAgMCAwIDAgMCAxDQorICAgICAgICAzICAgICAgICAgICAwIDAgMCAxIDEgMiAyIDMNCisgICAgICAgIDQgICAgICAgICAgIDAgMSAxIDIgMiAzIDMgNA0KKyAgICAgICAgNSAgICAgICAgICAgMCAxIDEgMiAzIDQgNCA1DQorICAgICAgICA2ICAgICAgICAgICAwIDEgMiAzIDQgNSA1IDYNCisgICAgICAgIDc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G9ja3MgdXNlZCBzaW11bHRhbmVvdXNseSwgZG8gbm90IHRhbXBlciB3aXRoICovCisKKy8qIGxlYXJuaW5nIHRyZWUgY29uc3RhbnRzICovCisjZGVmaW5lIElOSVRJQUxfRUxUX1NJWkUgICAgKDgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoqPCBpbml0aWFsIGJ5dGUgc2l6ZSBvZiB0cmVlIChlbXB0eSB1bnVzZWQgcm9vdCBzaXplKSAqLworI2RlZmluZSBNQVhfRUxUX1NJWkUgICAgICAgICg1MTIpICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKjwgbWF4aW11bSBudW1iZXIgb2YgZW50cmllcyAoaW5jbHVkZXMgdW51c2VkIHJvb3QpICovCisjZGVmaW5lIE1BWF9HV19TSVpFICAgICAgICAgKDMyKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoqPCBtYXhpbXVtIG51bWJlciBvZiBnYXRld2F5IGVudHJpZXMgKGluY2x1ZGluZyB1bnVzZWQgcm9vdCkgKi8KKyNkZWZpbmUgTUFYX0ZXX1NJWkUgICAgICAgICAoMzIpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKio8IG1heGltdW0gbnVtYmVyIG9mIGZpcmV3YWxsIGVudHJpZXMgKGluY2x1ZGluZyB1bnVzZWQgcm9vdCkgKi8KKyNkZWZpbmUgRUxUX0VOVFJZX1NJWkUgICAgICAoOCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKio8IGVudHJ5IHNpemUsIGluIGJ5dGVzICovCisjZGVmaW5lIEVMVF9ST09UX09GRlNFVCAgICAgKEVMVF9FTlRSWV9TSVpFKSAgICAgICAgICAgICAgICAgLyoqPCB0cmVlIHJvb3Qgb2Zmc2V0LCBpbiBieXRlcyAtIG5vZGUgcHJlY2VlZGluZyByb290IGlzIHVudXNlZCAqLworI2RlZmluZSBGVUxMX0VMVF9CWVRFX1NJWkUgIChNQVhfRUxUX1NJWkUgKiBFTFRfRU5UUllfU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gICAgICAgICAgICAgICAgICA0IDMgICAgICAgICAgICAgIDAgIAorICogIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tIAorICogfCAweDYgfCAweDkgfCAweDAgfCAweDUgfCAweDQgfCBEZXZpY2UgSUQgfCBYU2NhbGUgQ29yZSBGcmVxIElkIHwgU2kgU3RlcHBpbmcgSWQgfCAgICAKKyAqICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICoKKyAqICAgTWF4aW11bSBBY2hpZXZhYmxlIFhTY2FsZSBDb3JlIEZyZXF1ZW5jeSBJZCA6ICA1MzNNSHogIC0gMHgxQyAKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MDBNSHogIC0gMHgxRCAKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNjZNSHogIC0gMHgxRgorICoKKyAqICAgPGI+VEhFIENPUkUgRlJFUVVFTkNZIElEIElTIE5PVCBBUFBMSUNBQkxFIFRPIElYUDQ2WCA8XGI+CisgKiAgCisgKiAgIFRoZSBhYm92ZSBpcyBhcHBsaWNhYmxlIHRvIElYUDQyWCBvbmx5LiBDUDE1IGluIElYUDQ2WCBkb2VzIG5vdCBjb250YWluIGFueQorICogICBGcmVxdWVuY3kgSUQuIAorICogCisgKiAgU2kgU3RlcHBpbmcgSWQgICAgICAgICAgICA6ICBBICAgICAgIC0gMHgwICAgIAorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQiAgICAgICAtIDB4MSAKKyAqICAKKyAqICBYU2NhbGUgQ29yZSBmcmVxIElkIC0gRGV2aWNlIElEIFsxMTo5XSA6IElYUDQy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klORyA9IDAsICAgICAgIC8qKjwgRXRoREIgTGVhcm5pbmcgRmVhdHVyZSAqLworICAgIElYX0ZFQVRVUkVDVFJMX09SSUdCMF9ESVNQQVRDSEVSLCAgLyoqPCBJWFA0MlggQjAgYW5kIElYUDQ2WCBkaXNwYXRjaGVyIHdpdGhvdXQgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpdmVsb2NrIHByZXZlbnRpb24gZnVuY3Rpb25hbGl0eSBGZWF0dXJlICovCisgICAgSVhfRkVBVFVSRUNUUkxfU1dDT05GSUdfTUFYICAgICAgICAvKio8IE1heGltdW0gYm91ZGFyeSBmb3IgSXhGZWF0dXJlQ3RybFN3Q29uZmlnICAqLworfSBJeEZlYXR1cmVDdHJsU3dDb25maWc7CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogSVhQNDAwIEZlYXR1cmUgQ29udHJvbCBSZWdpc3RlcgorICogLSBJdCBjb250YWlucyB0aGUgaW5mb3JtYXRpb24gKGF2YWlsYWJsZS91bmF2YWlsYWJsZSkgb2YgSVhQNDI1JklYUDQ2WAorICogICBoYXJkd2FyZSBjb21wb25lbnRzIGluIHRoZWlyIGNvcnJlc3BvbmRpbmcgYml0IGxvY2F0aW9uLgorICogLSBCaXQgdmFsdWUgb2YgMCBtZWFucyB0aGUgaGFyZHdhcmUgY29tcG9uZW50IGlzIGF2YWlsYWJsZQorICogICBvciBub3Qgc29mdHdhcmUgZGlzYWJsZWQuIEhhcmR3YXJlIGNvbXBvbmVudCB0aGF0IGlzIGF2YWlsYWJsZQorICogICBjYW4gYmUgc29mdHdhcmUgZGlzYWJsZWQuCisgKiAtIEJpdCB2YWx1ZSBvZiAxIG1lYW5zIHRoZSBoYXJkd2FyZSBpcyB1bmF2YWlsYWJsZSBvciBzb2Z0d2FyZQorICogICBkaXNhYmxlZC5IYXJkd2FyZSBjb21wb25lbnQgdGhhdCBpcyB1bmF2YWlsYWJsZSBjYW5ub3QgYmUgc29mdHdhcmUKKyAqICAgZW5hYmxlZC4KKyAqIC0gVXNlIGl4RmVhdHVyZUN0cmxId0NhcGFiaWxpdHlSZWFkKCkgdG8gcmVhZCB0aGUgaGFyZHdhcmUgY29tcG9uZW50J3MKKyAqICAgYXZhaWxhYmlsaXR5LgorICogLSBVc2UgaXhGZWF0dXJlQ3RybFJlYWQoKSB0byBnZXQgdGhlIGN1cnJlbnQgSVhQNDI1L0lYUDQ2WCBmZWF0dXJlIGNvbnRyb2wKKyAqICAgcmVnaXN0ZXIgdmFsdWUuCisgKgorICogICBCaXQgICAgICAgICAgICBGaWVsZCBEZXNjcmlwdGlvbiAoSGFyZHdhcmUgQ29tcG9uZW50IEF2YWlsYWJpbGl0eSkKKyAqICAgLS0tICAgICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgKiAgICAwICAgICAgICAgICAgIFJDb21wIENpcmN1aXRyeQorICogICAgMSAgICAgICAgICAgICBVU0IgQ29udHJvbGxlcgorICogICAgMiAgICAgICAgICAgICBIYXNoaW5nIENvcHJvY2Vzc29yCisgKiAgICAzICAgICAgICAgICAgIEFFUyBDb3Byb2Nlc3NvcgorICogICAgNCAgICAgICAgICAgICBERVMgQ29wcm9jZXNzb3IKKyAqICAgIDUgICAgICAgICAgICAgSERMQyBDb3Byb2Nlc3NvcgorICogICAgNiAgICAgICAgICAgICBBQUwgQ29wcm9jZXNzb3IgICAgICAgICAtIEFsd2F5cyBhdmFpbGFibGUgaW4gSVhQNDZYCisgKiAgICA3ICAgICAgICAgICAgIEhTUyBDb3Byb2Nlc3NwcgorICogICAgOCAgICAgICAgICAgICBVdG9waWEgQ29wcm9jZXNzb3IKKyAqICAgIDkgICAgICAgICAgICAgRXRoZXJuZXQgMCBDb3Byb2Nlc3NvcgorICogICAxMCAgICAgICAgICAgICBFdGhlcm5ldCAxIENvcHJvY2Vzc29yCisgKiAgIDExICAgICAgICAgICAgIE5QRSBBCisgKiAgIDEyICAgICAgICAgICAgIE5QRSBCCisgKiAgIDEzICAgICAgICAgICAgIE5QRSBDCisgKiAgIDE0ICAgICAgICAgICAgIFBDSSBDb250cm9sbGVyCisgKiAgIDE1ICAgICAgICAgICAgIEVDQy9UaW1lU3luYyBDb3Byb2Nlc3NvciAtICBPbmx5IGFwcGxpY2FibGUgdG8gSVhQNDZYCisgKiAgMTYtMTcgICAgICAgICAgIFV0b3BpYSBQSFkgTGltaXQgU3RhdHVzIDogMHgwIC0gMzIgUEhZCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxIC0gMTYgUEhZCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyIC0gIDggUEhZCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzIC0gIDQgUEhZCisgKgorICogIFBvcnRpb25zIGJlbG93IGFyZSBvbmx5IGFwcGxpY2FibGUgdG8gSVhQNDZYCisgKiAgIDE4ICAgICAgICAgICAgIFVTQiBIb3N0IENvcHJvY2Vzc29yCisgKiAgIDE5ICAgICAgICAgICAgIE5QRSBBIEV0aGVybmV0IC0gMCBmb3IgRW5hYmxlIGlmIFV0b3BpYSA9IDEKKyAqICAgMjAgICAgICAgICAgICAgTlBFIEIgRXRoZXJuZXQgY29wcm9jZXNzb3IgMS0zLgorICogICAyMSAgICAgICAgICAgICBSU0EgQ3J5cHRvIEJsb2NrIGNvcHJvY2Vzc29yLgorICogIDIyLTIzICAgICAgICAgICBQcm9jZXNzb3IgZnJlcXVlbmN5IDogMHgwIC0gNTMzIE1IegorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxIC0gNjY3IE1IegorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgyIC0gNDAwIE1IegorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzIC0gMjY2IE1IegorICogIDI0LTMxICAgICAgICAgICBSZXNlcnZlZAorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKlNlY3Rpb24gZ2VuZXJpYyB0byBib3RoIElYUDQyWCBhbmQgSVhQNDZYKi8KKworLyoqCisgKiBAaW5ncm91cCBJeEZlYXR1cmVDdHJsQVBJCisgKgorICogQGVudW0gSXhGZWF0dXJlQ3RybENvbXBvbmVudFR5cGUKKyAqCisgKiBAYnJpZWYgRW51bWVyYXRpb24gZm9yIGNvbXBvbmVudHMgYXZhaWxhdmJsZQorICoKKyAqLwordHlwZWRlZiBlbnVtCit7CisgICAgSVhfRkVBVFVSRUNUUkxfUkNPTVAgPSAwLCAvKio8Yml0IGxvY2F0aW9uIGZvciBSQ29tcCBDaXJjdWl0cnkqLworICAgIElYX0ZFQVRVUkVDVFJMX1VTQiwgICAgICAgLyoqPGJpdCBsb2NhdGlvbiBmb3IgVVNCIENvbnRyb2xsZXIqLworICAgIElYX0ZFQVRVUkVDVFJMX0hBU0gsICAgICAgLyoqPGJpdCBsb2NhdGlvbiBmb3IgSGFzaGluZyBDb3Byb2Nlc3NvciovCisgICAgSVhfRkVBVFVSRUNUUkxfQUVTLCAgICAgICAvKio8Yml0IGxvY2F0aW9uIGZvciBBRVMgQ29wcm9jZXNzb3IqLworICAgIElYX0ZFQVRVUkVDVFJMX0RFUywgICAgICAgLyoqPGJpdCBsb2NhdGlvbiBmb3IgREVTIENvcHJvY2Vzc29yKi8KKyAgICBJWF9GRUFUVVJFQ1RSTF9IRExDLCAgICAgIC8qKjxiaXQgbG9jYXRpb24gZm9yIEhETEMgQ29wcm9jZXNzb3IqLworICAgIElYX0ZFQVRVUkVDVFJMX0FBTCwgICAgICAgLyoqPGJpdCBsb2NhdGlvbiBmb3Ig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HRoZSB1c2VyIGRlZmluZWQgaW5jbHVkZSBmaWxlcyByZXF1aXJlZAorICovCisjaW5jbHVkZSAiSXhPc2FsVHlwZXMuaCIKKyNpbmNsdWRlICJJeE5wZU1pY3JvY29kZS5oIgorCisvKgorICogI2RlZmluZXMgZm9yIGZ1bmN0aW9uIHJldHVybiB0eXBlcywgZXRjLgorICovCisKKy8qKgorICogQGRlZiBJWF9OUEVETF9QQVJBTV9FUlIKKyAqCisgKiBAYnJpZWYgTnBlRGwgZnVuY3Rpb24gcmV0dXJuIHZhbHVlIGZvciBhIHBhcmFtZXRlciBlcnJvcgorICovCisjZGVmaW5lIElYX05QRURMX1BBUkFNX0VSUiAgICAgICAgICAgICAgIDIKKworLyoqCisgKiBAZGVmIElYX05QRURMX1JFU09VUkNFX0VSUgorICoKKyAqIEBicmllZiBOcGVEbCBmdW5jdGlvbiByZXR1cm4gdmFsdWUgZm9yIGEgcmVzb3VyY2UgZXJyb3IKKyAqLworI2RlZmluZSBJWF9OUEVETF9SRVNPVVJDRV9FUlIgICAgICAgICAgICAzCisKKy8qKgorICogQGRlZiBJWF9OUEVETF9DUklUSUNBTF9OUEVfRVJSCisgKgorICogQGJyaWVmIE5wZURsIGZ1bmN0aW9uIHJldHVybiB2YWx1ZSBmb3IgYSBDcml0aWNhbCBOUEUgZXJyb3Igb2NjdXJpbmcgZHVyaW5nCisgICAgICAgICAgZG93bmxvYWQuIEFzc3VtZSBOUEUgaXMgbGVmdCBpbiB1bnN0YWJsZSBjb25kaXRpb24gaWYgdGhpcyB2YWx1ZSBpcworICAgICAgICAgIHJldHVybmVkIG9yIE5QRSBpcyBoYW5nIC8gaGFsdC4KKyAqLworI2RlZmluZSBJWF9OUEVETF9DUklUSUNBTF9OUEVfRVJSICAgICAgICA0CisKKy8qKgorICogQGRlZiBJWF9OUEVETF9DUklUSUNBTF9NSUNST0NPREVfRVJSCisgKgorICogQGJyaWVmIE5wZURsIGZ1bmN0aW9uIHJldHVybiB2YWx1ZSBmb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AgICAgICAgIGhhcyBiZWVuIGRvd25sb2FkZWQuCisgKiAgICAgICAgIC0gSWYgdGhlIGRvd25sb2FkIGZhaWxzIHdpdGggYSBjcml0aWNhbCBlcnJvciwgdGhlIE5QRSBtYXkKKyAqICAgICAgICAgICBiZSBsZWZ0IGluIGFuIHVzdXNhYmxlIHN0YXRlLgorICogQHJldHVybgorICogICAgICAgICAtIElYX1NVQ0NFU1MgaWYgdGhlIGRvd25sb2FkIHdhcyBzdWNjZXNzZnVsOworICogICAgICAgICAtIElYX05QRURMX1BBUkFNX0VSUiBpZiBhIHBhcmFtZXRlciBlcnJvciBvY2N1cmVkCisgKiAgICAgICAgIC0gSVhfTlBFRExfQ1JJVElDQUxfTlBFX0VSUiBpZiBhIGNyaXRpY2FsIE5QRSBlcnJvciBvY2N1cmVkIGR1cmluZworICogICAgICAgICAgIGRvd25sb2FkCisgKiAgICAgICAgIC0gSVhfTlBFRExfQ1JJVElDQUxfTUlDUk9DT0RFX0VSUiBpZiBhIGNyaXRpY2FsIG1pY3JvY29kZSBlcnJvcgorICogICAgICAgICAgIG9jY3VyZWQgZHVyaW5nIGRvd25sb2FkCisgKiAgICAgICAgIC0gSVhfTlBFRExfREVWSUNFX0VSUiBpZiB0aGUgaW1hZ2UgYmVpbmcgbG9hZGVkIGlzIG5vdCBtZWFudCBmb3IgCisgKiAgICAgICAgICAgdGhlIGRldmljZSBjdXJyZW50bHkgcnVubmluZy4KKyAqICAgICAgICAgLSBJWF9GQUlMIGlmIE5QRSBpcyBub3QgYXZhaWxhYmxlIG9yIGltYWdlIGlzIGZhaWxlZCB0byBiZSBsb2NhdGVkLgorICogICAgICAgICAgIEEgd2FybmluZyBpcyBpc3N1ZWQgaWYgdGhlIE5QRSBpcyBub3QgcHJlc2VudC4KKyAqLworUFVCTElDIElYX1NUQVRVUworaXhOcGVEbEN1c3RvbUltYWdlTnBlSW5pdEFuZFN0YXJ0IChVSU5UMzIgKmltYWdlTGlicmFyeSwKKyAgICAgICAgICA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ZCBAcmVmIGl4TnBlRGxDdXN0b21JbWFnZU5wZUluaXRBbmRTdGFydC4KKyAqCisgKiBAcHJlCisgKiAgICAgLSBUaGUgQ2xpZW50IHNob3VsZCBkZWNsYXJlIHRoZSB2YXJpYWJsZSB0byB3aGljaCBudW1JbWFnZXNQdHIgcG9pbnRzCisgKgorICogQHBvc3QKKyAqCisgKiBAcmV0dXJuCisgKiAgICAgLSBJWF9TVUNDRVNTIGlmIHRoZSBvcGVyYXRpb24gd2FzIHN1Y2Nlc3NmdWwKKyAqICAgICAtIElYX05QRURMX1BBUkFNX0VSUiBpZiBhIHBhcmFtZXRlciBlcnJvciBvY2N1cmVkCisgKiAgICAgLSBJWF9GQUlMIG90aGVyd2lzZQorICovCitQVUJMSUMgSVhfU1RBVFVTCitpeE5wZURsQXZhaWxhYmxlSW1hZ2VzQ291bnRHZXQgKFVJTlQzMiAqbnVtSW1hZ2VzUHRyKTsKKworLyoqCisgKiBAaW5ncm91cCBJeE5wZURsCisgKgorICogQGZuIFBVQkxJQyBJWF9TVEFUVVMgaXhOcGVEbEF2YWlsYWJsZUltYWdlc0xpc3RHZXQgKEl4TnBlRGxJbWFnZUlkICppbWFnZUlkTGlzdFB0ciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVJTlQzMiAqbGlzdFNpemVQdHIpCisgKgorICogQGJyaWVmIEdldCBhIGxpc3Qgb2YgdGhlIGltYWdlcyBhdmFpbGFibGUgaW4gYSBtaWNyb2NvZGUgaW1hZ2UgbGlicmFyeQorICoKKyAqIEBwYXJhbSBpbWFnZUlkTGlzdFB0ciBAcmVmIEl4TnBlRGxJbWFnZUlkKiBbb3V0XSAtIEFycmF5IHRvIGNvbnRhaW4gbGlzdCBvZgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWFnZSBJZHMgKG1lbW9yeQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGxvY2F0ZWQgYnkgQ2xpZW50KS4KKyAqIEBwYXJhbSBsaXN0U2l6ZVB0ciBVSU5UMzIqIFtpbm91dF0gIC0gQXMgYW4gaW5wdXQsIHRoaXMgcGFyYW0gc2hvdWxkIHBvaW50CisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvIHRoZSBtYXggbnVtYmVyIG9mIElkcyB0aGUKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGk+aW1hZ2VJZExpc3RQdHI8L2k+IGFycmF5IGNhbgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBob2xkLiBOcGVEbCB3aWxsIHJlcGxhY2UgdGhlIGlucHV0CisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlIG9mIHRoaXMgcGFyYW1ldGVyIHdpdGggdGhlCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bWJlciBvZiBpbWFnZSBJZHMgYWN0dWFsbHkgZmlsbGVkCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludG8gdGhlIGFycmF5IGJlZm9yZSByZXR1cm5pbmcuCisgKgorICogRmluZHMgbGlzdCBvZiBpbWFnZXMgYXZhaWxhYmxlIGluIHRoZSBtaWNyb2NvZGUgaW1hZ2UgbGlicmFyeS4KKyAqIEZpbGxzIHRoZXNlIGludG8gdGhlIGFycmF5IHBvaW50ZWQgdG8gYnkgPGk+aW1hZ2VJZExpc3RQdHI8L2k+CisgKgorICogQHdhcm5pbmcgPGI+VEhJUyBGVU5DVElPTiBIQVMgQkVFTiBERVBSRUNBVEVEIEFORCBTSE9VTEQgTk9UIEJFIFVTRUQuPC9iPgorICogICAgICAgSXQgd2lsbCBiZSByZW1vdmVkIGluIGEgZnV0dXJlIHJlbGVhc2UuCisgKiAgICAgICBTZWUgQHJlZi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5IHRvIGNvbnRhaW4KKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEgbGlzdCBvZiBpbWFnZXMuIElmIE5VTEwsCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbmx5IHRoZSBudW1iZXIgb2YgaW1hZ2VzIAorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXMgcmV0dXJuZWQgKGluCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aT5udW1JbWFnZXM8L2k+KQorICogQHBhcmFtIFVJTlQzMiogW2lub3V0XSBudW1JbWFnZXMgLSBBcyBpbnB1dCwgaXQgcG9pbnRzIHRvIGEgdmFyaWFibGUKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250YWluaW5nIHRoZSBudW1iZXIgb2YgaW1hZ2VzIHdoaWNoCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FuIGJlIHN0b3JlZCBpbiB0aGUKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aT5pbWFnZUxpc3RQdHI8L2k+IGFycmF5LiBJdHMgdmFsdWUKKyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpcyBpZ25vcmVkIGFzIGlucHV0IGlmCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGk+aW1hZ2VMaXN0UHRyPC9pPiBpcyBOVUxMLiBBcyBhbgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dHB1dCwgaXQgd2lsbCBjb250YWluIG51bWJlciBvZgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltYWdlcyBpbiB0aGUgaW1hZ2UgbGlicmFyeS4KKyAqIAorICogVGhpcyBmdW5jdGlvbiBy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iBQb2ludCAzKSByZWdpc3RlciBmcm9tIE5QRSBCYXNlCisgKiAgICAgICAgQWRkcmVzcworICovCisjZGVmaW5lIElYX05QRURMX1JFR19PRkZTRVRfQVAzCSAgICAgICAgICAgICAweDAwMDAwMDFDCQkKKworLyoqCisgKiBAZGVmIElYX05QRURMX1JFR19PRkZTRVRfV0ZJRk8KKyAqIEBicmllZiBPZmZzZXQgKGluIGJ5dGVzKSBvZiBXRklGTyAoV2F0Y2hwb2ludCBGSUZPKSByZWdpc3RlciBmcm9tIE5QRSBCYXNlCisgKiAgICAgICAgQWRkcmVzcworICovCisjZGVmaW5lIElYX05QRURMX1JFR19PRkZTRVRfV0ZJRk8gICAgICAgICAgICAweDAwMDAwMDIwCisKKy8qKgorICogQGRlZiBJWF9OUEVETF9SRUdfT0ZGU0VUX1dDCisgKiBAYnJpZWYgT2Zmc2V0IChpbiBieXRlcykgb2YgV0MgKFdhdGNoIENvdW50KSByZWdpc3RlciBmcm9tIE5QRSBCYXNlCisgKiAgICAgICAgQWRkcmVzcworICovCisjZGVmaW5lIElYX05QRURMX1JFR19PRkZTRVRfV0MJICAgICAgICAgICAgIDB4MDAwMDAwMjQgCQkKKworLyoqCisgKiBAZGVmIElYX05QRURMX1JFR19PRkZTRVRfUFJPRkNUCisgKiBAYnJpZWYgT2Zmc2V0IChpbiBieXRlcykgb2YgUFJPRkNUIChQcm9maWxlIENvdW50KSByZWdpc3RlciBmcm9tIE5QRSBCYXNlCisgKiAgICAgICAgQWRkcmVzcworICovCisjZGVmaW5lIElYX05QRURMX1JFR19PRkZTRVRfUFJPRkNUICAgICAgICAgICAweDAwMDAwMDI4CQkKKworLyoqCisgKiBAZGVmIElYX05QRURMX1JFR19PRkZTRVRfU1RBVAorICogQGJyaWVmIE9mZnNldCAoaW4gYnl0ZXMpIG9mIFNUQVQgKE1lc3NhZ2luZyBTdGF0dXMpIHJlZ2lzdGVyIGZyb20gTlBFIEJhc2UKKyAqICAgICAgICBBZGRyZXNzCisgKi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RF9OUEVfU1RFUAorICogQGJyaWVmIEVYQ1RMIENvbW1hbmQgdG8gU3RlcCBleGVjdXRpb24gb2YgYW4gTlBFIEluc3RydWN0aW9uCisgKi8KKworI2RlZmluZSBJWF9OUEVETF9FWENUTF9DTURfTlBFX1NURVAgICAgICAgICAgMHgwMQorCisvKioKKyAqIEBkZWYgSVhfTlBFRExfRVhDVExfQ01EX05QRV9TVEFSVAorICogQGJyaWVmIEVYQ1RMIENvbW1hbmQgdG8gU3RhcnQgTlBFIGV4ZWN1dGlvbgorICovCisjZGVmaW5lIElYX05QRURMX0VYQ1RMX0NNRF9OUEVfU1RBUlQgICAgICAgICAweDAyCisKKy8qKgorICogQGRlZiBJWF9OUEVETF9FWENUTF9DTURfTlBFX1NUT1AKKyAqIEBicmllZiBFWENUTCBDb21tYW5kIHRvIFN0b3AgTlBFIGV4ZWN1dGlvbgorICovCisjZGVmaW5lIElYX05QRURMX0VYQ1RMX0NNRF9OUEVfU1RPUCAgICAgICAgICAweDAzCisKKy8qKgorICogQGRlZiBJWF9OUEVETF9FWENUTF9DTURfTlBFX0NMUl9QSVBFCisgKiBAYnJpZWYgRVhDVEwgQ29tbWFuZCB0byBDbGVhciBOUEUgaW5zdHJ1Y3Rpb24gcGlwZWxpbmUKKyAqLworI2RlZmluZSBJWF9OUEVETF9FWENUTF9DTURfTlBFX0NMUl9QSVBFICAgICAgMHgwNAorCisvKioKKyAqIEBkZWYgSVhfTlBFRExfRVhDVExfQ01EX1JEX0lOU19NRU0KKyAqIEBicmllZiBFWENUTCBDb21tYW5kIHRvIHJlYWQgTlBFIGluc3RydWN0aW9uIG1lbW9yeSBhdCBhZGRyZXNzIGluIEVYQUQKKyAqICAgICAgICByZWdpc3RlciBhbmQgcmV0dXJuIHZhbHVlIGluIEVYREFUQSByZWdpc3RlcgorICovCisjZGVmaW5lIElYX05QRURMX0VYQ1RMX0NNRF9SRF9JTlNfTUVNICAgICAgICAweDEwCisKKy8qKgorICogQGRlZiBJWF9OUEV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JlZ2lzdGVycworICovCisjZGVmaW5lIElYX05QRURMX1JEX0lOU1RSX0xEVVIgICAgICAgICAgICAgICAgICAgICAwCisKKworLyoqCisgKiBAZW51bSBJeE5wZURsQ3R4dFJlZ051bQorICogQGJyaWVmIE51bWVyaWMgdmFsdWVzIHRvIGlkZW50aWZ5IHRoZSBOUEUgaW50ZXJuYWwgQ29udGV4dCBTdG9yZSByZWdpc3RlcnMKKyAqLwordHlwZWRlZiBlbnVtCit7CisgICAgSVhfTlBFRExfQ1RYVF9SRUdfU1RFVlQgPSAwLCAgLyoqPCBpZGVudGlmaWVzIFNURVZUICAgKi8KKyAgICBJWF9OUEVETF9DVFhUX1JFR19TVEFSVFBDLCAgICAvKio8IGlkZW50aWZpZXMgU1RBUlRQQyAqLworICAgIElYX05QRURMX0NUWFRfUkVHX1JFR01BUCwgICAgIC8qKjwgaWRlbnRpZmllcyBSRUdNQVAgICovCisgICAgSVhfTlBFRExfQ1RYVF9SRUdfQ0lOREVYLCAgICAgLyoqPCBpZGVudGlmaWVzIENJTkRFWCAgKi8KKyAgICBJWF9OUEVETF9DVFhUX1JFR19NQVggICAgICAgICAvKio8IFRvdGFsIG51bWJlciBvZiBDb250ZXh0IFN0b3JlIHJlZ2lzdGVycyAqLworfSBJeE5wZURsQ3R4dFJlZ051bTsKKworCisvKgorICogTlBFIENvbnRleHQgU3RvcmUgcmVnaXN0ZXIgbG9naWNhbCBhZGRyZXNzZXMKKyAqLworCisvKioKKyAqIEBkZWYgSVhfTlBFRExfQ1RYVF9SRUdfQUREUl9TVEVWVAorICogQGJyaWVmIExvZ2ljYWwgYWRkcmVzcyBvZiBTVEVWVCBOUEUgaW50ZXJuYWwgQ29udGV4dCBTdG9yZSByZWdpc3RlcgorICovCisjZGVmaW5lIElYX05QRURMX0NUWFRfUkVHX0FERFJfU1RFVlQgICAgICAweDAwMDAwMDFCCisKKy8qKgorICogQGRlZiBJWF9OUEVETF9DVFhUX1JFR19BRERSX1NUQVJUUEMKKyAqI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BAcHJlCisgKgorICogQHBvc3QKKyAqICAgICAtIGl4TnBlRGxOcGVNZ3JEZWJ1Z0luc3RydWN0aW9uUG9zdEV4ZWMoKSBzaG91bGQgYmUgY2FsbGVkIHRvIHJlc3RvcmUKKyAqICAgICAgIHJlZ2lzdGVycyB2YWx1ZXMgYWx0ZXJlZCBieSB0aGlzIGZ1bmN0aW9uCisgKgorICogQHJldHVybiBub25lCisgKi8gCit2b2lkCitpeE5wZURsTnBlTWdyRGVidWdJbnN0cnVjdGlvblByZUV4ZWMgKFVJTlQzMiBucGVCYXNlQWRkcmVzcyk7CisKKworLyoqCisgKiBAZm4gSVhfU1RBVFVTIGl4TnBlRGxOcGVNZ3JEZWJ1Z0luc3RydWN0aW9uRXhlYyAoVUlOVDMyIG5wZUJhc2VBZGRyZXNzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVSU5UMzIgbnBlSW5zdHJ1Y3Rpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVJTlQzMiBjdHh0TnVtLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVSU5UMzIgbGR1cikKKyAqIAorICogQGJyaWVmIEV4ZWN1dGVzIGEgc2luZ2xlIGluc3RydWN0aW9uIG9uIHRoZSBOUEUgYXQgdGhlIERlYnVnIEV4ZWN1dGlvbiBTdGFjaworICogICAgICAgIGxldmVsCisgKgorICogQHBhcmFtIFVJTlQzMiBbaW5dIG5wZUJhc2VBZGRyZXNzIC0gQmFzZSBBZGRyZXNzIG9mIE5QRQorICogQHBhcmFtIFVJTlQzMiBbaW5dIG5wZUluc3RydWN0aW9uIC0gVmFsdWUgdG8gd3JpdGUgdG8gSU5TVFIgKEluc3RydWN0aW9uKQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVnaXN0ZXIKKyAqIEBwYXJhbSBVSU5UMzIgW2luXSBjdHh0TnV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ICAgICAgICAgIEl4TnBlRGxDdHh0UmVnTnVtIGN0eHRSZWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVJTlQzMiBjdHh0UmVnVmFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCT09MIHZlcmlmeSkKKyAqIAorICogQGJyaWVmIFdyaXRlcyBhIHZhbHVlIHRvIGEgQ29udGV4dCBTdG9yZSByZWdpc3RlciBvbiBhbiBOUEUKKyAqCisgKiBAcGFyYW0gVUlOVDMyIFtpbl0gbnBlQmFzZUFkZHJlc3MgICAgIC0gQmFzZSBBZGRyZXNzIG9mIE5QRQorICogQHBhcmFtIFVJTlQzMiBbaW5dIGN0eHROdW0gICAgICAgICAgICAtIGNvbnRleHQgc3RvcmUgdG8gYWNjZXNzCisgKiBAcGFyYW0gSXhOcGVEbEN0eHRSZWdOdW0gW2luXSBjdHh0UmVnIC0gd2hpY2ggQ29udGV4dCBTdG9yZSByZWcgdG8gd3JpdGUKKyAqIEBwYXJhbSBVSU5UMzIgW2luXSBjdHh0UmVnVmFsICAgICAgICAgLSB2YWx1ZSB0byB3cml0ZSB0byB0aGUgQ29udGV4dCBTdG9yZQorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZ2lzdGVyCisgKiBAcGFyYW0gQk9PTCAgIFtpbl0gdmVyaWZ5ICAgICAgICAgICAgIC0gaWYgVFJVRSwgdmVyaWZ5IHRoZSByZWdpc3RlciBpcworICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXR0ZW4gc3VjY2Vzc2Z1bGx5LgorICogCisgKiBUaGlzIGZ1bmN0aW9uIHdyaXRlcyB0aGUgY29udGVudHMgb2YgYSBDb250ZXh0IFN0b3JlIHJlZ2lzdGVyIGluIHRoZSBOUEUgCisgKiByZWdpc3RlciBmaWxlLiBJZiB0aGUgPGk+dmVyaWZ5PC9pPiBvcHRpb24ga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01zZygKKyAgICBjaGFyICpwRm9ybWF0LCAKKyAgICAuLi4KKyAgICApCit7ICAgIAorI2lmbmRlZiBJTl9LRVJORUwKKyAgICBzdGF0aWMgV0NIQVIgICAgcE91dHB1dFN0cmluZ1syNTZdOyAKKwlzdGF0aWMgY2hhciAgICAgcE5hcnJvd1N0clsyNTZdOworICAgIGludCAgICAgICAgICAgICByZXR1cm5DbnQgPSAwOyAKKyAgICB2YV9saXN0IGFwOworICAgIAorICAgIHBPdXRwdXRTdHJpbmdbMF0gPSAwOyAKKwlwTmFycm93U3RyWzBdID0gMDsJCisgICAgCisgICAgdmFfc3RhcnQoYXAsIHBGb3JtYXQpOworCisJcmV0dXJuQ250ID0gX3ZzbnByaW50ZihwTmFycm93U3RyLCAyNTYsIHBGb3JtYXQsIGFwKTsKKworICAgIE11bHRpQnl0ZVRvV2lkZUNoYXIoCisgICAgICAgICAgICBDUF9BQ1AsIAorICAgICAgICAgICAgTUJfUFJFQ09NUE9TRUQsIAorICAgICAgICAgICAgcE5hcnJvd1N0ciwgCisgICAgICAgICAgICAtMSwgCisgICAgICAgICAgICBwT3V0cHV0U3RyaW5nLCAKKyAgICAgICAgICAgIDI1NgorICAgICAgICAgICAgKTsgCisKKyAgICBPdXRwdXREZWJ1Z1N0cmluZyhwT3V0cHV0U3RyaW5nKTsKKworICAgIHJldHVybiByZXR1cm5DbnQ7IAorI2Vsc2UKKyAgICByZXR1cm4gMDsgCisjZW5kaWYKK30KKyNkZWZpbmUgcHJpbnRmIGl4TG9nTXNnCisKKyNlbmRpZiAvKiBJWF9VU0VfU0VSQ09OU09MRSAqLworCisjZW5kaWYgLyogX193aW5jZSAqLworCisvKioKKyAqIEB9IEl4T3NQcmludGYKKyAqLworCisjZW5kaWYgLyogSXhPc1ByaW50Zl9IICovCmRpZmYgLS1naXQgYS9jcHUvaXhwL25wZS9pbmNsdWRlL0l4T3NTZXJ2aWNlcy5oIGIvY3B1L2l4cC9ucGUvaW5jbHVkZS9JeE9zU2Vyd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qKioqKioqKioqKioKKyAqIHRpbWVTeW5jQWNjCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF90aW1lU3luY0FjYykKKworI2lmIGRlZmluZWQgKElYX09TU0VSVl9WWFdPUktTX0xFKQorCisjZGVmaW5lIENTUl9MRV9EQVRBX0NPSEVSRU5UX01BUFBJTkcKKworI2VuZGlmIC8qIElYX09TU0VSVl9WWFdPUktTX0xFICovCisKKyNlbmRpZiAvKiB0aW1lU3luY0FjYyAqLworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBwYXJpdHlFTkFjYworICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfcGFyaXR5RU5BY2MpCisKKyNpZiBkZWZpbmVkIChJWF9PU1NFUlZfVlhXT1JLU19MRSkKKworI2RlZmluZSBDU1JfTEVfREFUQV9DT0hFUkVOVF9NQVBQSU5HCisKKyNlbmRpZiAvKiBJWF9PU1NFUlZfVlhXT1JLU19MRSAqLworCisjZW5kaWYgLyogcGFyaXR5RU5BY2MgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogY29kZWxldHNfcGFyaXR5RU5BY2MKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X2NvZGVsZXRzX3Bhcml0eUVOQWNjKQorCisjaWYgZGVmaW5lZCAoSVhfT1NTRVJWX1ZYV09SS1NfTEUpCisKKyNkZWZpbmUgQ1NSX0xFX0RBVEFfQ09IRVJFTlRfTUFQUElORworCisjZW5kaWYgLyogSVhfT1NTRVJWX1ZYV09SS1NfTEUgKi8KKworI2VuZGlmIC8qIGNvZGVsZXRzX3Bhcml0eUVOQWNjICovCisKKyNlbmRpZiAvKiBJeE9zU2VydmljZXNDb21wb25lbnRzX0ggKi8KKw0KKy8qKioqKioqKioqKioqKioq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AgICAgLSB1bmJpbmQgaW50ZXJydXB0cyBmcm9tIGhhbmRsZXJzCisgKiAgICAgICAgICAgICAJLSBkaXNhYmxlcyBhbGwgaW50ZXJydXB0cyAKKyAqICAgICAgICAgICAgICAtIGVuYWJsZXMgYWxsIGludGVycnVwdHMgCisgKiAgICAgICAgICAgICAgLSBzZWxlY3RpdmVseSBkaXNhYmxlcyBpbnRlcnJ1cHRzIAorICogICAgICAgICAgICAgIC0gZW5hYmxlcyBhbiBpbnRlcnJ1cHQgbGV2ZWwgCisgKiAgICAgICAgICAgICAgLSBkaXNhYmxlcyBhbiBpbnRlcnJ1cHQgbGV2ZWwgCisgKiAgICAgIC0jIE1lbW9yeQorICogICAgICAgICAgICAgIC0gYWxsb2NhdGVzIG1lbW9yeQorICogICAgICAgICAgICAgIC0gZnJlZXMgbWVtb3J5IAorICogICAgICAgICAgICAgIC0gY29waWVzIG1lbW9yeSB6b25lcyAKKyAqICAgICAgICAgICAgICAtIGZpbGxzIGEgbWVtb3J5IHpvbmUgCisgKiAgICAgICAgICAgICAgLSBhbGxvY2F0ZXMgY2FjaGUtc2FmZSBtZW1vcnkgCisgKiAgICAgICAgICAgICAgLSBmcmVlcyBjYWNoZS1zYWZlIG1lbW9yeSAKKyAqICAgICAgICAgICAgICAtIHBoeXNpY2FsIHRvIHZpcnR1YWwgYWRkcmVzcyB0cmFuc2xhdGlvbiAKKyAqICAgICAgICAgICAgICAtIHZpcnR1YWwgdG8gcGh5c2ljYWwgYWRkcmVzcyB0cmFuc2xhdGlvbiAKKyAqICAgICAgICAgICAgICAtIGNhY2hlIHRvIG1lbW9yeSBmbHVzaCAKKyAqICAgICAgICAgICAgICAtIGNhY2hlIGxpbmUgaW52YWxpZGF0ZSAKKyAqICAgICAgLSMgVGhyZWFkcworICogICAgICAgICAgICAgIC0gY3JlYXRlcyBhIG5ldyB0aHJlYWQgCisgKiAgICAgICAgICAgICAgLSBzdGFydHMgYSBuZXdseSBjcmVhdGVkIHRocmVhZCAKKyAqICAgICAgICAgICAgICAtIGtpbGxzIGFuIGV4aXN0aW5nIHRocmVhZCAKKyAqICAgICAgICAgICAgICAtIGV4aXRzIGEgcnVubmluZyB0aHJlYWQgCisgKiAgICAgICAgICAgICAgLSBzZXRzIHRoZSBwcmlvcml0eSBvZiBhbiBleGlzdGluZyB0aHJlYWQgCisgKiAgICAgICAgICAgICAgLSBzdXNwZW5kcyB0aHJlYWQgZXhlY3V0aW9uIAorICogICAgICAgICAgICAgIC0gcmVzdW1lcyB0aHJlYWQgZXhlY3V0aW9uIAorICogICAgICAtIyBJUEMKKyAqICAgICAgICAgICAgICAtIGNyZWF0ZXMgYSBtZXNzYWdlIHF1ZXVlIAorICogICAgICAgICAgICAgIC0gZGVsZXRlcyBhIG1lc3NhZ2UgcXVldWUgCisgKiAgICAgICAgICAgICAgLSBzZW5kcyBhIG1lc3NhZ2UgdG8gYSBtZXNzYWdlIHF1ZXVlIAorICogICAgICAgICAgICAgIC0gcmVjZWl2ZXMgYSBtZXNzYWdlIGZyb20gYSBtZXNzYWdlIHF1ZXVlCisgKiAgICAgIC0jIFRocmVhZCBTeW5jaHJvbmlzYXRpb24KKyAqICAgICAgICAgICAgICAtIGluaXRpYWxpemVzIGEgbXV0ZXggCisgKiAgICAgICAgICAgICAgLSBsb2NrcyBhIG11dGV4IAorICogICAgICAgICAgICAgIC0gdW5sb2NrcyBhIG11dGV4IAorICogICAgICAgICAgICAgIC0gbm9uLWJsb2NraW5nIGF0dGVtcHQgdG8gbG9jayBhIG11dGV4IAorICogICAgICAgICAgICAgIC0gZGVzdHJveXMgYSBtdXRleCBvYmplY3QgCisgKiAgICAgICAgICAgICAgLSBpbml0aWFsaXplcyBhIGZhc3QgbXV0ZXggCisgKiAgICAgICAgICAgICAgLSBub24tYmxvY2tpbmcgYXR0ZW1wdCB0byBsb2NrIGEgZmFzdCBtdXRleCAKKyAqICAgICAgICAgICAgICAtIHVubG9ja3MgYSBmYXN0IG11dGV4IAorICogICAgICAgICAgICAgIC0gZGVzdHJveXMgYSBmYXN0IG11dGV4IG9iamVjdCAKKyAqICAgICAgICAgICAgICAtIGluaXRpYWxpemVzIGEgc2VtYXBob3JlIAorICogICAgICAgICAgICAgIC0gcG9zdHMgdG8gKGluY3JlbWVudHMpIGEgc2VtYXBob3JlIAorICogICAgICAgICAgICAgIC0gd2FpdHMgb24gKGRlY3JlbWVudHMpIGEgc2VtYXBob3JlIAorICogICAgICAgICAgICAgIC0gbm9uLWJsb2NraW5nIHdhaXQgb24gc2VtYXBob3JlIAorICogICAgICAgICAgICAgIC0gZ2V0cyBzZW1hcGhvcmUgdmFsdWUgCisgKiAgICAgICAgICAgICAgLSBkZXN0cm95cyBhIHNlbWFwaG9yZSBvYmplY3QgCisgKiAgICAgICAgICAgICAgLSB5aWVsZHMgZXhlY3V0aW9uIG9mIGN1cnJlbnQgdGhyZWFkIAorICogICAgICAtIyBUaW1lIGZ1bmN0aW9ucworICogICAgICAgICAgICAgIC0geWllbGRpbmcgc2xlZXAgZm9yIGEgbnVtYmVyIG9mIG1pbGxpc2Vjb25kcyAKKyAqICAgICAgICAgICAgICAtIGJ1c3kgc2xlZXAgZm9yIGEgbnVtYmVyIG9mIG1pY3Jvc2Vjb25kcyAKKyAqICAgICAgICAgICAgICAtIHZhbHVlIG9mIHRoZSB0aW1lc3RhbXAgY291bnRlciAKKyAqICAgICAgICAgICAgICAtIHJlc29sdXRpb24gb2YgdGhlIHRpbWVzdGFtcCBjb3VudGVyIAorICogICAgICAgICAgICAgIC0gc3lzdGVtIGNsb2NrIHJhdGUsIGluIHRpY2tzIAorICogICAgICAgICAgICAgIC0gY3VycmVudCBzeXN0ZW0gdGltZSAKKyAqICAgICAgICAgICAgICAtIGNvbnZlcnRzIGl4T3NhbFRpbWVWYWwgaW50byB0aWNrcyAKKyAqICAgICAgICAgICAgICAtIGNvbnZlcnRzIHRpY2tzIGludG8gaXhPc2FsVGltZVZhbCAKKyAqICAgICAgICAgICAgICAtIGNvbnZlcnRzIGl4T3NhbFRpbWVWYWwgdG8gbWlsbGlzZWNvbmRzIAorICogICAgICAgICAgICAgIC0gY29udmVydHMgbWlsbGlzZWNvbmRzIHRvIEl4T3NhbFRpbWV2YWwgCisgKiAgICAgICAgICAgICAgLSAiZXF1YWwiIGNvbXBhcmlzb24gZm9yIEl4T3NhbFRpbWV2YWwgCisgKiAgICAgICAgICAgICAgLSAibGVzcyB0aGFuIiBjb21wYXJpc29uIGZvciBJeE9zYWxUaW1ldmFsIAorICogICAgICAgICAgICAgIC0gImdyZWF0ZXIgdGhhbiIgY29tcGFyaXNvbiBmb3IgSXhPc2FsVGltZXZhbCAKKyAqICAgICAgICAgICAgICAtICJhZGQiIG9wZXJhdG9yIGZvciBJeE9zYWxUaW1ldmFsIAorICogICAgICAgICAgICAgIC0gInN1YnRyYWN0IiBvcGVyYXRvciBmb3IgSXhPc2FsVGltZXZhbCAKKyAqICAgICAgLSMgTG9nZ2luZworICogICAgICAgICAgICAgIC0gc2V0cyB0aGUgY3VycmVudCBsb2dnaW5nIHZlcmJvc2l0eSBsZXZlbCAKKyAqICAgICAgICAgICAgICAtIGludGVycnVwdC1zYWZlIGxvZ2dpbmcgZnVuY3Rpb24gCisgKiAgICAgIC0jIFRpbWVyIHNlcnZpY2VzCisgKiAgICAgICAgICAgICAgLSBzY2hlZHVsZXMgYSByZXBlYXRpbmcgdGltZXIgCisgKiAgICAgICAgICAgICAgLSBzY2hlZHVsZXMgYSBzaW5nbGUtc2hvdCB0aW1lciAKKyAqICAgICAgICAgICAgICAtIGNhbmNlbHMgYSBydW5uaW5nIHRpbWVyIAorICogICAgICAgICAgICAgIC0gZGlzcGxheXMgYWxsIHRoZSBydW5uaW5nIHRpbWVycyAKKyAqICAgICAgLSMgT3B0aW9uYWwgTW9kdWxlcworICogICAgICAgICAgICAgIC0gQnVmZmVyIG1hbmFnZW1lbnQgbW9kdWxlCisgKiAgICAgICAgICAgICAgLSBJL08gbWVtb3J5IGFuZCBlbmRpYW5lc3Mgc3Vwc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ZBSUwKKyAqLworUFVCTElDIElYX1NUQVRVUyBpeE9zYWxNZXNzYWdlUXVldWVSZWNlaXZlIChJeE9zYWxNZXNzYWdlUXVldWUgKiBxdWV1ZSwKKwkJCQkJICAgIFVJTlQ4ICogbWVzc2FnZSk7CisKKworLyogPT09PT09PT09PT09PT09PT09PT09PT0gIFRocmVhZCBTeW5jaHJvbmlzYXRpb24gPT09PT09PT09PT09PT09PT09PT09PT09CisgKiAKKyAqLworCisvKiogCisgKiBAaW5ncm91cCBJeE9zYWwKKyAqCisgKiBAYnJpZWYgaW5pdGlhbGl6ZXMgYSBtdXRleAorICoKKyAqIEBwYXJhbSBtdXRleCAtIG11dGV4IGhhbmRsZQorICoKKyAqIEluaXRpYWxpemVzIGEgbXV0ZXggb2JqZWN0CisgKgorICogQGxpIFJlZW50cmFudDogbm8KKyAqIEBsaSBJUlEgc2FmZTogIG5vCisgKgorICogQHJldHVybiAtIElYX1NVQ0NFU1MvSVhfRkFJTAorICovCitQVUJMSUMgSVhfU1RBVFVTIGl4T3NhbE11dGV4SW5pdCAoSXhPc2FsTXV0ZXggKiBtdXRleCk7CisKKy8qKiAKKyAqIEBpbmdyb3VwIEl4T3NhbAorICoKKyAqIEBicmllZiBsb2NrcyBhIG11dGV4CisgKgorICogQHBhcmFtIG11dGV4IC0gbXV0ZXggaGFuZGxlCisgKiBAcGFyYW0gdGltZW91dCAtIHRpbWVvdXQgaW4gbXM7IElYX09TQUxfV0FJVF9GT1JFVkVSICgtMSkgdG8gd2FpdCBmb3JldmVyCisgKiAgICAgICAgICAgICAgICAgIG9yIElYX09TQUxfV0FJVF9OT05FIHRvIHJldHVybiBpbW1lZGlhdGVseQorICoKKyAqIExvY2tzIGEgbXV0ZXggb2JqZWN0CisgKgorICogQGxpIFJlZW50cmFudDogeWVzCisgKiBAbGkgSVJRIHNhZmU6ICBubworICoKKyAqIEByZXR1cm4gLSBJWF9TVUNDRVNTL0lYX0ZBSUwKKyAqLworUFVCTElDIElYX1NUQV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USU1FX1NVQih0dkEsIHR2QikgICBcCisgICAgICAgIGlmICgodHZBKS5uc2VjcyA+PSAodHZCKS5uc2VjcykgXAorICAgICAgICB7IFwKKyAgICAgICAgICAodHZBKS5zZWNzIC09ICh0dkIpLnNlY3M7IFwKKyAgICAgICAgICAodHZBKS5uc2VjcyAtPSAodHZCKS5uc2VjczsgXAorICAgICAgICB9IFwKKyAgICAgICAgZWxzZSBcCisgICAgICAgIHsgXAorICAgICAgICAgICh0dkEpLnNlY3MgLT0gKCh0dkIpLnNlY3MgKyAxKTsgXAorICAgICAgICAgICh0dkEpLm5zZWNzICs9IElYX09TQUxfQklMTElPTiAtICh0dkIpLm5zZWNzOyBcCisgICAgICAgIH0KKworCisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PSBMb2dnaW5nICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIAorICovCisKKy8qKiAKKyAqIEBpbmdyb3VwIEl4T3NhbAorICoKKyAqIEBicmllZiBJbnRlcnJ1cHQtc2FmZSBsb2dnaW5nIGZ1bmN0aW9uCisgKgorICogQHBhcmFtIGxldmVsIC0gaWRlbnRpZmllciBwcmVmaXggZm9yIHRoZSBtZXNzYWdlCisgKiBAcGFyYW0gZGV2aWNlIC0gb3V0cHV0IGRldmljZQorICogQHBhcmFtIGZvcm1hdCAtIG1lc3NhZ2UgZm9ybWF0LCBpbiBhIHByaW50ZiBmb3JtYXQKKyAqIEBwYXJhbSAuLi4gLSB1cCB0byA2IGFyZ3VtZW50cyB0byBiZSBwcmludGVkCisgKgorICogSVJRLXNhZmUgbG9nZ2luZyBmdW5jdGlvbiwgc2ltaWxhciB0byBwcmludGYuIEFjY2VwdHMgdXAgdG8gNiBhcmd1bWVudHMKKyAqIHRvIHByaW50IChleGNsdWRpbmcgdGhlIGxldmVsLCBkZXZpY2UgYW5kIHRoZSBmb3JtYXQpLiBUaGlzIGZ1bmN0aW9uIHdpbGwKKyAqIGFjdHVhbGx5IGRpc3BsYXkg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0YQorCisKKworLyogTmFtZSBsZW5ndGggKi8KKyNkZWZpbmUgSVhfT1NBTF9NQlVGX1BPT0xfTkFNRV9MRU4gIDY0CisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIE1hY3JvcyBmb3IgYnVmZmVyIHBvb2wgbWFuYWdlbWVudAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qKgorICogQGluZ3JvdXAgSXhPc2FsQnVmZmVyTWd0CisgKgorICogQGRlZiBJWF9PU0FMX01CVUZfUE9PTF9GUkVFX0NPVU5UKG1fcG9vbF9wdHIKKyAqCisgKiBAYnJpZWYgUmV0dXJuIHRoZSB0b3RhbCBudW1iZXIgb2YgZnJlZWQgYnVmZmVycyBsZWZ0IGluIHRoZSBwb29sLgorICovCisjZGVmaW5lIElYX09TQUxfTUJVRl9QT09MX0ZSRUVfQ09VTlQobV9wb29sX3B0cikgXAorICAgICAgICAgICAgICAgICAgICBpeE9zYWxCdWZmUG9vbEZyZWVDb3VudEdldChtX3Bvb2xfcHRyKQorCisvKioKKyAqIEBpbmdyb3VwIEl4T3NhbEJ1ZmZlck1ndAorICoKKyAqIEBkZWYgSVhfT1NBTF9NQlVGX1BPT0xfU0laRV9BTElHTgorICoKKyAqIEBicmllZiBUaGlzIG1hY3JvIHRha2VzIGFuIGludGVnZXIgYXMgYW4gYXJndW1lbnQgYW5kCisgKiByb3VuZHMgaXQgdXAgdG8gYmUgYSBtdWx0aXBsZSBvZiB0aGUgbWVtb3J5IGNhY2hlLWxpbmUgCisgKiBzaXplLgorICoKKyAqIEBwYXJhbSBpbnQgW2luXSBzaXplIC0gdGhlIHNpemUgaW50ZWdlciB0byBiZSByb3VuZGVkIHVwCisgKgorICogQHJldHVybiBpbnQgLSB0aGUgc2l6ZSwgcm91bmRlZCB1cCB0byBhIG11bHRpcGxlIG9mCisgKiAgICAgICAgICAgICAgIHRo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orICovCisjaWYgZGVmaW5lZCAoSVhfT1NBTF9MSU5VWF9CRSkgfHwgZGVmaW5lZCAoSVhfT1NBTF9WWFdPUktTX0JFKQorCisjZGVmaW5lIElYX1NEUkFNX0JFCisKKyNlbGlmIGRlZmluZWQgKElYX09TQUxfVlhXT1JLU19MRSkKKworI2RlZmluZSBJWF9TRFJBTV9MRV9EQVRBX0NPSEVSRU5UCisKKyNlbGlmIGRlZmluZWQgKElYX09TQUxfTElOVVhfTEUpCisKKyNkZWZpbmUgSVhfU0RSQU1fTEVfREFUQV9DT0hFUkVOVAorCisjZWxpZiBkZWZpbmVkIChJWF9PU0FMX1dJTkNFX0xFKQorCisjZGVmaW5lIElYX1NEUkFNX0xFX0RBVEFfQ09IRVJFTlQKKworI2VsaWYgZGVmaW5lZCAoSVhfT1NBTF9FQk9PVF9MRSkKKworI2RlZmluZSBJWF9TRFJBTV9MRV9BRERSRVNTX0NPSEVSRU5UCisKKyNlbmRpZgorCisKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFJldHJpZXZlIGN1cnJlbnQgY29tcG9uZW50IG1hcHBpbmcgKgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisvKgorICogT25seSB1c2UgY3VzdG9taXplZCBtYXBwaW5nIGZvciBMRS4gCisgKiAKKyAqLworI2lmIGRlZmluZWQgKElYX09TQUxfVlhXT1JLU19MRSkgfHwgZGVmaW5lZCAoSVhfT1NBTF9MSU5VWF9MRSkgfHwgZGVmaW5lZCAoSVhfT1NBTF9XSU5DRV9MRSkgfHwgZGVmaW5lZCAoSVhfT1NBTF9FQk9PVF9MRSkKKworI2luY2x1ZGUgIkl4T3NhbE9zSXhwNDAwQ3VzdG9taXplZE1hcHBpbmcuaCIKKworI2VuZGlmCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFR1cm4gb2ZmIElYX1NUQVRJQ19NRU1PUlkgbWFwIGZvciBjb21wb25lbnRzIHVzaW5nIGR5bmFtaWMgbWFwcyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZmRlZiBJWF9PU0FMX0RZTkFNSUNfTUVNT1JZX01BUAorCisjdW5kZWYgSVhfT1NBTF9TVEFUSUNfTUVNT1JZX01BUAorCisjZW5kaWYKKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBUdXJuIG9mZiBCRSBhY2Nlc3MgZm9yIGNvbXBvbmVudHMgdXNpbmcgTEUgb3Igbm8gbWFwcGluZyAqCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisjaWYgKCBkZWZpbmVkIChJWF9PU0FMX0xFX0FDX01BUFBJTkcpIHx8IGRlZmluZWQgKElYX09TQUxfTEVfRENfTUFQUElORykgfHwgZGVmaW5lZCAoSVhfT1NBTF9OT19NQVBQSU5HKSApCisKKyN1bmRlZiBJWF9PU0FMX0JFX01BUFBJTkcKKworI2VuZGlmCisKKworLyoqKioqKioqKioqKioqKioqCisgKiBTYWZldHkgY2hlY2tzICoKKyAqKioqKioqKioqKioqKioqKi8KKworLyogRGVmYXVsdCB0byBub19tYXBwaW5nICovCisjaWYgIWRlZmluZWQgKElYX09TQUxfQkVfTUFQUElORykgJiYgIWRlZmluZWQgKElYX09TQUxfTEVfQUNfTUFQUElORykgJiYgIWRlZmluZWQgKElYX09TQUxfTEVfRENfTUFQUElORykgJiYgIWRlZmluZWQgKElYX09TQUxfTk9fTUFQUElORykKKworI2RlZmluZSBJWF9PU0FMX05PX01BUFBJTkcKKworI2VuZGlmIC8qIGNoZWNrIGF0IGxlYXN0IG9uZSBtYXBwaW5nICovCisKKy8qIE5vIG1vcmUgdGhhbiBvbmUgb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IDMpIDw8IDMpKTsKKyAgICAqYXV4Q29va2llIHw9IChVSU5UMzIpIGJWYWwgPDwgKDMgLSAoKCh1bnNpZ25lZCkgYkNvb2tpZSAmIDMpIDw8IDMpKTsKKyNlbHNlCisgICAgKmJDb29raWUgPSBiVmFsOworI2VuZGlmCit9CisKKworI2RlZmluZSBJWF9PU0FMX1JFQURfTE9OR19DT09LSUUod0Nvb2tpZSkgICAgICAgICAgIChpeE9zYWxXaW5DRVJlYWRMQ29va2llKHdDb29raWUpKQorI2RlZmluZSBJWF9PU0FMX1JFQURfU0hPUlRfQ09PS0lFKHNDb29raWUpICAgICAgICAgIChpeE9zYWxXaW5DRVJlYWRXQ29va2llKHNDb29raWUpKQorI2RlZmluZSBJWF9PU0FMX1JFQURfQllURV9DT09LSUUoYkNvb2tpZSkgICAgICAgICAgIChpeE9zYWxXaW5DRVJlYWRCQ29va2llKGJDb29raWUpKQorI2RlZmluZSBJWF9PU0FMX1dSSVRFX0xPTkdfQ09PS0lFKHdDb29raWUsIHdEYXRhKSAgIChpeE9zYWxXaW5DRVdyaXRlTENvb2tpZSh3Q29va2llLCB3RGF0YSkpCisjZGVmaW5lIElYX09TQUxfV1JJVEVfU0hPUlRfQ09PS0lFKHNDb29raWUsIHNEYXRhKSAgKGl4T3NhbFdpbkNFV3JpdGVXQ29va2llKHNDb29raWUsIHNEYXRhKSkKKyNkZWZpbmUgSVhfT1NBTF9XUklURV9CWVRFX0NPT0tJRShiQ29va2llLCBiRGF0YSkgICAoaXhPc2FsV2luQ0VXcml0ZUJDb29raWUoYkNvb2tpZSwgYkRhdGEpKQorCisjZW5kaWYgLyogd2luY2UgKi8KKworI2lmIGRlZmluZWQgKF9fdnh3b3JrcykgfHwgKGRlZmluZWQgKF9fbGludXgpICYmIGRlZmluZWQgKElYX09TQUxfU1RBVElDX01FTU9SWV9NQVApKSB8fCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAoZGVmaW5lZCAoX193aW5jZSkgJiYgZGVmaW5l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9PU0JVRl9QVFIoIChJWF9PU0FMX01CVUYgKikgaXhwQnVmUHRyKSA9ICh2b2lkICopIG9zQnVmUHRyOyBcCisgICAgICAgICAgICBJWF9PU0FMX01CVUZfTURBVEEoKElYX09TQUxfTUJVRiAqKSBpeHBCdWZQdHIpID0gIElYX09TQUxfT1NCVUZfTURBVEEob3NCdWZQdHIpOyBcCisgICAgICAgICAgICBJWF9PU0FMX01CVUZfUEtUX0xFTigoSVhfT1NBTF9NQlVGICopIGl4cEJ1ZlB0cikgPSBJWF9PU0FMX09TQlVGX1BLVF9MRU4ob3NCdWZQdHIpOyBcCisgICAgICAgICAgICBJWF9PU0FMX01CVUZfTUxFTigoSVhfT1NBTF9NQlVGICopIGl4cEJ1ZlB0cikgPSBJWF9PU0FMX09TQlVGX01MRU4ob3NCdWZQdHIpOyBcCisgICAgICAgIH0KKworI2RlZmluZSBJWF9PU0FMX09TX0NPTlZFUlRfSVhQQlVGX1RPX09TQlVGKCBpeHBCdWZQdHIsIG9zQnVmUHRyKSBcCisgICAgICAgIHsgXAorICAgICAgICAgICAgaWYgKGl4cEJ1ZlB0ciA9PSBOVUxMKSBcCisgICAgICAgICAgICB7IC8qIERvIG5vdGhpbmcgKi8gfSBcCisgICAgICAgICAgICBlbHNlIFwKKyAgICAgICAgICAgIHsgXAorICAgICAgICAgICAgICAgIChNX0JMSyAqKSBvc0J1ZlB0ciA9IChNX0JMSyAqKSBJWF9PU0FMX01CVUZfT1NCVUZfUFRSKChJWF9PU0FMX01CVUYgKikgaXhwQnVmUHRyKTsgXAorICAgICAgICAgICAgICAgIGlmIChvc0J1ZlB0ciA9PSBOVUxMKSBcCisgICAgICAgICAgICAgICAgeyAvKiBEbyBub3RoaW5nICovIH0gXAorICAgICAgICAgICAgICAgIGVsc2UgXAorICAgICAgICAgICAgICAgIHsgXAorICAgICAgICAgICAgICAgICAgICBJWF9PU0FMX09TQlVGX01MRU4ob3NCdWZQdHIpID1JWF9PU0FMX01CVUZfTUxFTigoSVh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24gICAqLworICAgICAwLAkJCQkvKiByZWZDb3VudCAgICAgICAgKi8KKyAgICAgSVhfT1NBTF9CRSB8IElYX09TQUxfTEVfQUMsLyogZW5kaWFuVHlwZSAgICAgICovCisgICAgICJnbG9iYWxfbG93IgkJLyogbmFtZSAgICAgICAgICAgICovCisgICAgIH0sCisKKyAgICAvKiBTRFJBTSBMRV9EQyBhbGlhcyAqLworICAgIHsKKyAgICAgSVhfT1NBTF9TVEFUSUNfTUFQLAkvKiB0eXBlICAgICAgICAgICAgKi8KKyAgICAgMHgwMDAwMDAwMCwJCS8qIHBoeXNpY2FsQWRkcmVzcyAqLworICAgICAweDEwMDAwMDAwLAkJLyogc2l6ZSAgICAgICAgICAgICovCisgICAgIDB4MzAwMDAwMDAsCQkvKiB2aXJ0dWFsQWRkcmVzcyAgKi8KKyAgICAgTlVMTCwJCQkvKiBtYXBGdW5jdGlvbiAgICAgKi8KKyAgICAgTlVMTCwJCQkvKiB1bm1hcEZ1bmN0aW9uICAgKi8KKyAgICAgMCwJCQkJLyogcmVmQ291bnQgICAgICAgICovCisgICAgIElYX09TQUxfTEVfREMsCQkvKiBlbmRpYW5UeXBlICAgICAgKi8KKyAgICAgInNkcmFtX2RjIgkJCS8qIG5hbWUgICAgICAgICAgICAqLworICAgICB9LAorCisgICAgLyogUU1HUiBMRV9EQyBhbGlhcyAqLworICAgIHsKKyAgICAgSVhfT1NBTF9TVEFUSUNfTUFQLAkvKiB0eXBlICAgICAgICAgICAgKi8KKyAgICAgMHg2MDAwMDAwMCwJCS8qIHBoeXNpY2FsQWRkcmVzcyAqLworICAgICAweDAwMTAwMDAwLAkJLyogc2l6ZSAgICAgICAgICAgICovCisgICAgIDB4NjAwMDAwMDAsCQkvKiB2aXJ0dWFsQWRkcmVzcyAgKi8KKyAgICAgTlVMTCwJCQkvKiBtYXBGdW5jdGlvbiAgICAgKi8KKyAgICAgTlVMTCwJCQkvKiB1bm1hcEZ1bmN0aW9uICAgKi8KKyAgICAgMCwJCQkJLyogcmVmQ291bnQgICAgICAgICovCisgICAgIElYX09TQUxfTEVfREMsCQkvKiBlbmRpYW5UeXBlICAgICAgKi8KKyAgICAgInFtZ3JfZGMiCQkJLyogbmFtZSAgICAgICAgICAgICovCisgICAgIH0sCisKKyAgICAvKiBRTUdSIEJFIGFsaWFzICovCisgICAgeworICAgICBJWF9PU0FMX1NUQVRJQ19NQVAsCS8qIHR5cGUgICAgICAgICAgICAqLworICAgICAweDYwMDAwMDAwLAkJLyogcGh5c2ljYWxBZGRyZXNzICovCisgICAgIDB4MDAxMDAwMDAsCQkvKiBzaXplICAgICAgICAgICAgKi8KKyAgICAgMHg2MDAwMDAwMCwJCS8qIHZpcnR1YWxBZGRyZXNzICAqLworICAgICBOVUxMLAkJCS8qIG1hcEZ1bmN0aW9uICAgICAqLworICAgICBOVUxMLAkJCS8qIHVubWFwRnVuY3Rpb24gICAqLworICAgICAwLAkJCQkvKiByZWZDb3VudCAgICAgICAgKi8KKyAgICAgSVhfT1NBTF9CRSB8IElYX09TQUxfTEVfQUMsLyogZW5kaWFuVHlwZSAgICAgICovCisgICAgICJxbWdyX2JlIgkJCS8qIG5hbWUgICAgICAgICAgICAqLworICAgICB9LAorCisgICAgLyogR2xvYmFsIEJFIGFuZCBMRV9BQyBtYXAgKi8KKyAgICB7CisgICAgIElYX09TQUxfU1RBVElDX01BUCwJLyogdHlwZSAgICAgICAgICAgICovCisgICAgIDB4NDAwMDAwMDAsCQkvKiBwaHlzaWNhbEFkZHJlc3MgKi8KKyAgICAgMHgyMDAwMDAwMCwJCS8qIHNpemUgICAgICAgICAgICAqLworICAgICAweDQwMDAwMDAwLAkJLyogdmlydHVhbEFkZHJlc3MgICovCisgICAgIE5VTEwsCQkJLyogbWFwRnVuY3Rpb24gICAgICovCisgICAgIE5VTEwsCQkJLyogdW5tYXBGdW5jdGlvbiAgICovCisgICAgIDAsCQkJCS8qIHJlZkNvdW50ICAgICAgICAqLworICAgICBJWF9PU0FMX0JFIHwgSVhfT1N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ndCBoYXZlIHRvIGJlIGluIHRoaXMgbGlzdCBpZgorICAqIHRoZSBkZWZhdWx0IG1hcHBpbmcgaXMgT0suCisgICovCisjZGVmaW5lIGl4X29zYWwgICAgICAgICAgICAgICAgMQorI2RlZmluZSBpeF9kbWFBY2MgICAgICAgICAgICAgIDIKKyNkZWZpbmUgaXhfYXRtZEFjYyAgICAgICAgICAgICAzCisKKyNkZWZpbmUgaXhfYXRtc2NoICAgICAgICAgICAgICA1CisjZGVmaW5lIGl4X2V0aEFjYyAgICAgICAgICAgICAgNgorI2RlZmluZSBpeF9ucGVNaCAgICAgICAgICAgICAgIDcKKyNkZWZpbmUgaXhfcW1nciAgICAgICAgICAgICAgICA4CisjZGVmaW5lIGl4X25wZURsICAgICAgICAgICAgICAgOQorI2RlZmluZSBpeF9hdG1tICAgICAgICAgICAgICAgIDEwCisjZGVmaW5lIGl4X2hzc0FjYyAgICAgICAgICAgICAgMTEKKyNkZWZpbmUgaXhfZXRoREIgICAgICAgICAgICAgICAxMgorI2RlZmluZSBpeF9ldGhNaWkgICAgICAgICAgICAgIDEzCisjZGVmaW5lIGl4X3RpbWVyQ3RybCAgICAgICAgICAgMTQKKyNkZWZpbmUgaXhfYWRzbCAgICAgICAgICAgICAgICAxNQorI2RlZmluZSBpeF91c2IgICAgICAgICAgICAgICAgIDE2CisjZGVmaW5lIGl4X3VhcnRBY2MgICAgICAgICAgICAgMTcKKyNkZWZpbmUgaXhfZmVhdHVyZUN0cmwgICAgICAgICAxOAorI2RlZmluZSBpeF9jcnlwdG9BY2MgICAgICAgICAgIDE5CisjZGVmaW5lIGl4X3VubG9hZEFjYyAgICAgICAgICAgMzMKKyNkZWZpbmUgaXhfcGVyZlByb2ZBY2MgICAgICAgICAzNAorI2RlZmluZSBpeF9wYXJpdHlFTkFjYyAgICAgICAgICAgICAgICAgNDkKKyNkZWZpbmUgaXhfc3NwQWNjICAgICAgICAgICAgICAgICAgICAgIDUxCisjZGVmaW5lIGl4X3RpbWVTeW5jQWNjICAgICAgICAgICAgICAgICA1MgorI2RlZmluZSBpeF9pMmMgICAgICAgICAgICAgICAgICAgICAgICAgNTMKKworI2RlZmluZSBpeF9jb2RlbGV0c191YXJ0QWNjICAgIDIxCisjZGVmaW5lIGl4X2NvZGVsZXRzX3RpbWVycyAgICAgMjIKKyNkZWZpbmUgaXhfY29kZWxldHNfYXRtICAgICAgICAyMworI2RlZmluZSBpeF9jb2RlbGV0c19ldGhBYWw1QXBwIDI0CisjZGVmaW5lIGl4X2NvZGVsZXRzX2RlbW9VdGlscyAgMjYKKyNkZWZpbmUgaXhfY29kZWxldHNfdXNiICAgICAgICAyNworI2RlZmluZSBpeF9jb2RlbGV0c19oc3NBY2MgICAgIDI4CisjZGVmaW5lIGl4X2NvZGVsZXRzX2RtYUFjYyAgICAgICAgIDQwCisjZGVmaW5lIGl4X2NvZGVsZXRzX2NyeXB0b0FjYwkgICA0MQorI2RlZmluZSBpeF9jb2RlbGV0c19wZXJmUHJvZkFjYyAgICA0MgorI2RlZmluZSBpeF9jb2RlbGV0c19ldGhBY2MgICAgICAgICA0MworI2RlZmluZSBpeF9jb2RlbGV0c19wYXJpdHlFTkFjYyAgICAgICAgNTQKKyNkZWZpbmUgaXhfY29kZWxldHNfdGltZVN5bmNBY2MgICAgICAgIDU1CisKKworI2VuZGlmIC8qIEl4T3NhbE9zSXhwNDAwQ3VzdG9taXplZE1hcHBpbmdfSCAqLworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIG9zYWwKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X29zYWwpCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9BQ19NQVBQSU5HCisKKyNlbmRpZiAvKiBvc2FsICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIGRtYUFjYworICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfZG1hQWNjKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogZG1hQWNjICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIGF0bWRBY2MKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X2F0bWRBY2MpCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9BQ19NQVBQSU5HCisKKyNlbmRpZiAvKiBhdG1kQWNjICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIGF0bXNjaAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfYXRtc2NoKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogYXRtc2NoICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIGV0aEFjYworICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfZXRoQWNjKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogZXRoQWNjICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIG5wZU1oCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9ucGVNaCkKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIG5wZU1oICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIHFtZ3IKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X3FtZ3IpCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9EQ19NQVBQSU5HCisKKyNlbmRpZiAvKiBxbWdyICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIG5wZURsCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9ucGVEbCkKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIG5wZURsICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIGF0bW0KKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X2F0bW0pCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9BQ19NQVBQSU5HCisKKyNlbmRpZiAvKiBhdG1tICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIGV0aE1paQorICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfZXRoTWlpKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogZXRoTWlpICovCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogYWRzbAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfYWRzbCkKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIGFkc2wgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogdXNiCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF91c2IpCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9BQ19NQVBQSU5HCisKKyNlbmRpZiAvKiB1c2IgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogdWFydEFjYworICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfdWFydEFjYykKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIHVhcnRBY2MgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogZmVhdHVyZUN0cmwKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X2ZlYXR1cmVDdHJsKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogZmVhdHVyZUN0cmwgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogY3J5cHRvQWNjCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9jcnlwdG9BY2MpCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9BQ19NQVBQSU5HCisKKyNlbmRpZiAvKiBjcnlwdG9BY2MgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogY29kZWxldHNfdXNiCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9jb2RlbGV0c191c2IpCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9BQ19NQVBQSU5HCisKKyNlbmRpZiAvKiBjb2RlbGV0c191c2IgKi8KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBjb2RlbGV0c191YXJ0QWNjCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9jb2RlbGV0c191YXJ0QWNjKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogY29kZWxldHNfdWFydEFjYyAqLworCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogY29kZWxldHNfdGltZXJzCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9jb2RlbGV0c190aW1lcnMpCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9BQ19NQVBQSU5HCisKKyNlbmRpZiAvKiBjb2RlbGV0c190aW1lcnMgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogY29kZWxldHNfYXRtCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9jb2RlbGV0c19hdG0pCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9BQ19NQVBQSU5HCisKKyNlbmRpZiAvKiBjb2RlbGV0c19hdG0gKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogY29kZWxldHNfZXRoQWFsNUFwcAorICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfY29kZWxldHNfZXRoQWFsNUFwcCkKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIGNvZGVsZXRzX2V0aEFhbDVBcHAgKi8KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogY29kZWxldHNfZXRoQWNjCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9jb2RlbGV0c19ldGhBY2MpCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9BQ19NQVBQSU5HCisKKyNlbmRpZiAvKiBjb2RlbGV0c19ldGhBY2MgKi8KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBjb2RlbGV0c19kZW1vVXRpbHMKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X2NvZGVsZXRzX2RlbW9VdGlscykKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIGNvZGVsZXRzX2RlbW9VdGlscyAqLworCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogcGVyZlByb2ZBY2MKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X3BlcmZQcm9mQWNjKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogcGVyZlByb2ZBY2MgKi8KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiB1bmxvYWRBY2MKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X3VubG9hZEFjYykKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIHVubG9hZEFjYyAqLworCisKKworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIHBhcml0eUVOQWNjCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9wYXJpdHlFTkFjYykKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIHBhcml0eUVOQWNjICovCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIGNvZGVsZXRzX3Bhcml0eUVOQWNjCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9jb2RlbGV0c19wYXJpdHlFTkFjYykKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIGNvZGVsZXRzX3Bhcml0eUVOQWNjICovCisKKworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIHRpbWVTeW5jQWNjCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF90aW1lU3luY0FjYykKKworI2RlZmluZSBJWF9PU0FMX0xFX0FDX01BUFBJTkcKKworI2VuZGlmIC8qIHRpbWVTeW5jQWNjICovCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogY29kZWxldHNfdGltZVN5bmNBY2MKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisjaWYgKElYX0NPTVBPTkVOVF9OQU1FID09IGl4X2NvZGVsZXRzX3RpbWVTeW5jQWNjKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogY29kZWxldHNfdGltZVN5bmNBY2MgKi8KKworCisKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogaTJjCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqLworI2lmIChJWF9DT01QT05FTlRfTkFNRSA9PSBpeF9pMmMpCisKKyNkZWZpbmUgSVhfT1NBTF9MRV9BQ19NQVBQSU5HCisKKyNlbmRpZiAvKiBpMmMgKi8KKworCisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIHNzcEFjYworICoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKyNpZiAoSVhfQ09NUE9ORU5UX05BTUUgPT0gaXhfc3NwQWNjKQorCisjZGVmaW5lIElYX09TQUxfTEVfQUNfTUFQUElORworCisjZW5kaWYgLyogc3NwQWNjICovCisKKwpkaWZmIC0tZ2l0IGEvY3B1L2l4cC9ucGUvaW5jbHVkZS9JeE9zYWxPc1R5cGVzLmggYi9jcHUvaXhwL25wZS9pbmNsdWRlL0l4T3NhbE9zVHlwZXMuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5mNWY5ZWNhCi0tLSAvZGV2L251bGwKKysrIGIvY3B1L2l4cC9ucGUvaW5jbHVkZS9JeE9zYWxPc1R5cGVzLmgKQEAgLTAsMCArMSw2MCBAQ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Bhcml0eUVycm9yQ29udGV4dE1lc3NhZ2UgKi8KK3sKKyAgSXhQYXJpdHlFTkFjY1Bhcml0eUVycm9yU291cmNlICAgICBwZWNQYXJpdHlTb3VyY2U7IC8qKjwgU291cmNlIGluZm8gb2YgcGFyaXR5IGVycm9yICovCisgIEl4UGFyaXR5RU5BY2NQYXJpdHlFcnJvckFjY2VzcyAgICAgcGVjQWNjZXNzVHlwZTsgICAvKio8IFJlYWQgb3IgV3JpdGUgQWNjZXNzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlYWQgIC0gTlBFLCBTV0NQLCBBUU0sIEREUiBNQ1UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXhwIEJ1cyBDdHJsciAoT3V0Ym91bmQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdyaXRlIC0gRERSIE1DVSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHAgQnVzIEN0cmxyIChJbmJvdW5kIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkuZS4sIEV4dGVybmFsIE1hc3RlcikgKi8KKyAgSXhQYXJpdHlFTkFjY1Bhcml0eUVycm9yQWRkcmVzcyAgICBwZWNBZGRyZXNzOyAgICAgIC8qKjwgQWRkcmVzcyBmYXVsdHkgbG9jYXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVmFsaWQgb25seSBmb3IgQVFNLCBERFIgTUNVLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXhwIEJ1cyBDdHJsciAqLworICBJeFBhcml0eUVOQWNjUGFyaXR5RXJyb3JEYXRhICAgICAgIHBlY0RhdGE7ICAgICAgICAgLyoqPCBEYXRhIHJlYWQgZnJvbSB0aGUgZmF1bHR5IGxvY2F0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZhbGlkIG9ubHkgZm9yIEFRTSBhbmQgRERSIE1DVQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGb3IgRERSIE1DVSBpdCBpcyB0aGUgYml0IGxvY2F0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mIHRoZSBTaW5nbGUtYml0IHBhcml0eSAqLworICBJeFBhcml0eUVOQWNjUGFyaXR5RXJyb3JSZXF1ZXN0ZXIgIHBlY1JlcXVlc3RlcjsgICAgLyoqPCBSZXF1ZXN0ZXIgb2YgU0RSQU0gbWVtb3J5IGFjY2VzcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWYWxpZCBvbmx5IGZvciB0aGUgRERSIE1DVSAqLworICBJeFBhcml0eUVOQWNjQUhCRXJyb3JUcmFuc2FjdGlvbiAgIGFoYkVycm9yVHJhbjsgICAgLyoqPCBNYXN0ZXIgYW5kIFNsYXZlIGluZm9ybWF0aW9uIG9uIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXN0IEFIQiBFcnJvciBUcmFuc2FjdGlvbiAqLworfSBJeFBhcml0eUVOQWNjUGFyaXR5RXJyb3JDb250ZXh0TWVzc2FnZTsKKworLyoqCisgKiBAaW5ncm91cCBJeFBhcml0eUVOQWNjCisgKgorICogQHR5cGVkZWYgSXhQYXJpdHlFTkFjY0NhbGxiYWNrCisgKgorICogQGJyaWVmIFRo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KiAgICAgICAgICAgICAgICAgICAgICBDbGllbnQgYXBwbGljYXRpb24gaGFzIHRvIHRha2UgYXBwcm9wcmlhdGUgYWN0aW9uIGFuZCAKKyAqICAgICAgICAgICAgICAgICAgICAgIHJlLWNvbmZpZ3VyZSB0aGUgcGFyaXR5IGVycm9yIGRldGVjdGlvbiBzdWJzZXF1ZW50bHkuIAorICogICAgICAgICAgICAgICAgICAgICAgVGhlIGNsaWVudCBhcHBsaWNhdGlvbiB3aWxsIG5vdCBiZSBub3RpZmllZCBvZiBmdXJ0aGVyIAorICogICAgICAgICAgICAgICAgICAgICAgaW50ZXJydXB0cywgdW50aWwgdGhlIHJlLWNvbmZpZ3VyYXRpb24gaXMgZG9uZSB1c2luZworICogICAgICAgICAgICAgICAgICAgICAgQHJlZiBpeFBhcml0eUVOQWNjUGFyaXR5RGV0ZWN0aW9uQ29uZmlndXJlLgorICoKKyAqICBOUEUtQiAgICAgICAgICAgICBJbnRlcnJ1cHQgd2lsbCBiZSBtYXNrZWQgb2ZmIGF0IHRoZSBpbnRlcnJ1cHQgY29udHJvbGxlciAKKyAqICAgICAgICAgICAgICAgICAgICBzbyB0aGF0IGl0IHdpbGwgbm90IHRyaWdnZXIgY29udGludW91c2x5LgorICogICAgICAgICAgICAgICAgICAgICAgQ2xpZW50IGFwcGxpY2F0aW9uIGhhcyB0byB0YWtlIGFwcHJvcHJpYXRlIGFjdGlvbiBhbmQgCisgKiAgICAgICAgICAgICAgICAgICAgICByZS1jb25maWd1cmUgdGhlIHBhcml0eSBlcnJvciBkZXRlY3Rpb24gc3Vic2VxdWVudGx5LiAKKyAqICAgICAgICAgICAgICAgICAgICAgIFRoZSBjbGllbnQgYXBwbGljYXRpb24gd2lsbCBub3QgYmUgbm90aWZpZWQgb2YgZnVydGhlcgorICogICAgICAgICAgICAgICAgICAgICAgaW50ZXJydXB0cywgdW50aWwgdGhlIHJlLWNvbmZpZ3VyYXRpb24gaXMgZG9uZSB1c2luZworICogICAgICAgICAgICAgICAgICAgICAgQHJlZiBpeFBhcml0eUVOQWNjUGFyaXR5RGV0ZWN0aW9uQ29uZmlndXJlLgorICoKKyAqICBOUEUtQyAgICAgICAgICAgICBJbnRlcnJ1cHQgd2lsbCBiZSBtYXNrZWQgb2ZmIGF0IHRoZSBpbnRlcnJ1cHQgY29udHJvbGxlciAKKyAqICAgICAgICAgICAgICAgICAgICAgIENsaWVudCBhcHBsaWNhdGlvbiBoYXMgdG8gdGFrZSBhcHByb3ByaWF0ZSBhY3Rpb24gYW5kIAorICogICAgICAgICAgICAgICAgICAgICAgcmUtY29uZmlndXJlIHRoZSBwYXJpdHkgZXJyb3IgZGV0ZWN0aW9uIHN1YnNlcXVlbnRseS4gCisgKiAgICAgICAgICAgICAgICAgICAgICBUaGUgY2xpZW50IGFwcGxpY2F0aW9uIHdpbGwgbm90IGJlIG5vdGlmaWVkIG9mIGZ1cnRoZXIKKyAqICAgICAgICAgICAgICAgICAgICAgIGludGVycnVwdHMsIHVudGlsIHRoZSByZS1jb25maWd1cmF0aW9uIGlzIGRvbmUgdXNpbmcKKyAqICAgICAgICAgICAgICAgICAgICAgIEByZWYgaXhQYXJpdHlFTkFjY1Bhcml0eURldGVjdGlvbkNvbmZpZ3VyZS4KKyAqCisgKiAgU1dDUCAgICAgICAgICAgICAgSW50ZXJydXB0IHdpbGwgYmUgbWFza2VkIG9mZiBhdCB0aGUgaW50ZXJydXB0IGNvbnRyb2xsZXIuCisgKiAgICAgICAgICAgICAgICAgICAgICBDbGllbnQgYXBwbGljYXRpb24gaGFzIHRvIHRha2UgYXBwcm9wcmlhdGUgYWN0aW9uIGFuZCAKKyAqICAgICAgICAgICAgICAgICAgICAgIHJlLWNvbmZpZ3VyZSB0aGUgcGFyaXR5IGVycm9yIGRldGVjdGlvbiBzdWJzZXF1ZW50bHkuIAorICogICAgICAgICAgICAgICAgICAgICAgVGhlIGNsaWVudCBhcHBsaWNhdGlvbiB3aWxsIG5vdCBiZSBub3RpZmllZCBvZiBmdXJ0aGVyCisgKiAgICAgICAgICAgICAgICAgICAgICBpbnRlcnJ1cHRzLCB1bnRpbCB0aGUgcmUtY29uZmlndXJhdGlvbiBpcyBkb25lIHVzaW5nCisgKiAgICAgICAgICAgICAgICAgICAgICBAcmVmIGl4UGFyaXR5RU5BY2NQYXJpdHlEZXRlY3Rpb25Db25maWd1cmUuCisgKgorICogIEFRTSAgICAgICAgICAgICAgIEludGVycnVwdCB3aWxsIGJlIG1hc2tlZCBvZmYgYXQgdGhlIGludGVycnVwdCBjb250cm9sbGVyLgorICogICAgICAgICAgICAgICAgICAgICAgICAgQ2xpZW50IGFwcGxpY2F0aW9uIGhhcyB0byB0YWtlIGFwcHJvcHJpYXRlIGFjdGlvbiBhbmQgCisgKiAgICAgICAgICAgICAgICAgICAgICAgICByZS1jb25maWd1cmUgdGhlIHBhcml0eSBlcnJvciBkZXRlY3Rpb24gc3Vic2VxdWVudGx5LiAKKyAqICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSBjbGllbnQgYXBwbGljYXRpb24gd2lsbCBub3QgYmUgbm90aWZpZWQgb2YgZnVydGhlcgorICogICAgICAgICAgICAgICAgICAgICAgICAgaW50ZXJydXB0cywgdW50aWwgdGhlIHJlLWNvbmZpZ3VyYXRpb24gaXMgZG9uZSB1c2luZworICogICAgICAgICAgICAgICAgICAgICAgICAgQHJlZiBpeFBhcml0eUVOQWNjUGFyaXR5RGV0ZWN0aW9uQ29uZmlndXJlLgorICoKKyAqICBNQ1UgICAgICAgICAgICAgICBQYXJpdHkgaW50ZXJydXB0IGNvbmRpdGlvbiBpcyBjbGVhcmVkIGF0IHRoZSBTRFJBTSBNQ1UgZm9yIAorICogICAgICAgICAgICAgICAgICAgIHRoZSBmb2xsb3dpbmc6CisgKiAgICAgICAgICAgICAgICAgICAgMS4gU2luZ2xlLWJpdAorICogICAgICAgICAgICAgICAgICAgIDIuIE11bHRpLWJpdAorICogICAgICAgICAgICAgICAgICAgIDMuIE92ZXJmbG93IGNvbmRpdGlvbiBpLmUuLCBtb3JlIHRoYW4gdHdvIHBhcml0eSBjb25kaXRpb25zIAorICogICAgICAgICAgICAgICAgICAgICAgIG9jY3VycmVkCisgKiAgICAgICAgICAgICAgICAgICAgTm90ZSB0aGF0IHNpbmdsZS1wYXJpdHkgZXJyb3JzIGRvIG5vdCByZXN1bHQgaW4gZGF0YSBhYm9ydAorICogICAgICAgICAgICAgICAgICAgIGFuZCBub3QgYWxsIGRhdGEgYWJvcnRzIGNhdXNlZCBieSBtdWx0aS1iaXQgcGFyaXR5IGVycm9yLgorICoKKyAqICBFWFAgICAgICAgICAgICAgICBQYXJpdHkgaW50ZXJydXB0IGNvbmRpdGlvbiBpcyBjbGVhcmVkIGF0IHRoZSBleHBhbnNpb24gYnVzIAorICogICAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXIgZm9yIHRoZSBmb2xsb3dpbmc6CisgKiAgICAgICAgICAgICAgICAgICAgMS4gRXh0ZXJuYWwgbWFzdGVyIGluaXRpYXRlZCBJbmJvdW5kIHdyaXRlCisgKiAgICAgICAgICAgICAgICAgICAgMi4gSW50ZXJuYWwgbWFzdGVyIChJWFA0MDApIGluaXRpYXRlZCBPdXRib3VuZCByZWFkCisgKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiA8L3ByZT4KKyAqIEBsaSAgIFJlLWVudHJhbnQgICA6IE5vCisgKiBAbGkgICBJU1IgQ2FsbGFibGUgOiBObworICoKKyAqIEByZXR1cm4gQGxpIElYX1BBUklUWUVOQUNDX1NVQ0NFU1MtVGhlIHBhcmFtZXRlcnMgY2hlY2sgcGFzc2VkIGFuZCB0aGUgcmVxdWVzdAorICogICAgICAgICAgICAgdG8gY2xlYXIgdGhlIHBhcml0eSBlcnJvciBpbnRlcnJ1cHQgY29uZGl0aW9uIGlzIHN1Y2Nlc3NmdWwuCisgKiAgICAgICAgIEBsaSBJWF9QQVJJVFlFT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io8bWVhc3VyZW1lbnQgaW4KKwkJCQkJCQkJCQkJCQkJCSpwcm9ncmVzcworCQkJCQkJCQkJCQkJCQkJKi8KKwlJWF9QRVJGUFJPRl9BQ0NfU1RBVFVTX1hDWUNMRV9OT19CQVNFTElORSwgLyoqPG5vIGJhc2VsaW5lIHlldCovCSAKKwlJWF9QRVJGUFJPRl9BQ0NfU1RBVFVTX1hDWUNMRV9NRUFTVVJFTUVOVF9SRVFVRVNUX09VVF9PRl9SQU5HRSwgLyoqPCAKKwkJCQkJCQkJCQkJCQkJCSogTWVhc3VyZW1lbnQgY2hvc2VuIAorCQkJCQkJCQkJCQkJCQkJKiBpcyBvdXQgb2YgcmFuZ2UKKwkJCQkJCQkJCQkJCQkJCSovCisJSVhfUEVSRlBST0ZfQUNDX1NUQVRVU19YQ1lDTEVfUFJJT1JJVFlfU0VUX0ZBSUwsICAvKio8CisJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIENhbm5vdCBzZXQgCisJCQkJCQkJCQkJCQkJCSAqIHRhc2sgcHJpb3JpdHkKKwkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisJSVhfUEVSRlBST0ZfQUNDX1NUQVRVU19YQ1lDTEVfVEhSRUFEX0NSRUFURV9GQUlMLCAvKio8IAorCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBGYWlsIGNyZWF0ZSB0aHJlYWQKKwkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisJSVhfUEVSRlBST0ZfQUNDX1NUQVRVU19YQ1lDTEVfUFJJT1JJVFlfUkVTVE9SRV9GQUlMLCAgLyoqPAorCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpjYW5ub3QgcmVzdG9yZQorCSAgICAgICAgICAgICAgIC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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgKiBAaW5ncm91cCBJeFBlcmZQcm9mQWNjICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICogQGZuIGl4UGVyZlByb2ZBY2NYc2NhbGVQbXVSZXN1bHRzR2V0KEl4UGVyZlByb2ZBY2NYc2NhbGVQbXVSZXN1bHRzICpyZXN1bHRzKSAgICAgCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICogQGJyaWVmIFJlYWRzIHRoZSBjdXJyZW50IHZhbHVlIG9mIHRoZSBjb3VudGVycyBhbmQgdGhlaXIgb3ZlcmZsb3cgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICogQHBhcmFtICpyZXN1bHRzIEByZWYgSXhQZXJmUHJvZkFjY1hzY2FsZVBtdVJlc3VsdHMgW291dF0gLSBwb2ludGVyIHRvIHRoZSAKKyAgICAgICAgICByZXN1bHRzIHN0cnVjdC4gIEl0IGlzIHRoZSB1c2VyJ3MgcmVzcG9uc2liaWxpdHkgdG8gYWxsb2NhdGUgbWVtb3J5CisgICAgICAgICAgZm9yIHRoaXMgcG9pbnRlcgorICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAqIFRoaXMgQVBJIHJlYWRzIHRoZSB2YWx1ZSBvZiBhbGwgZm91ciBldmVudCBjb3VudGVycyBhbmQgdGhlIGNsb2NrIGNvdW50ZXIsIAorICogYW5kIHRoZSBhc3NvY2lhdGVkIG92ZXJmbG93cy4gIEl0IGRvZXMgbm90IGdpdmUgcmVzdWx0cyBhc3NvY2lhdGVkIHdpdGggCisgKiBzYW1wbGluZywgaS5lLiBQQyBhbmQgdGhlaXIgZnJlcXVlbmNpZXMuICBUaGlzIEFQSSBjYW4gYmUgY2FsbGVkIGF0IGFueSB0aW1lCisgKiBvbmNlIGEgcHJvY2VzcyBoYXMgYmVlbiBzdGFydGVkLiBJZiBpdCBpcyBjYWxsZWQgYmVmb3JlIGEgcHJvY2VzcyBoYXMgc3RhcnRlZAorICogdGhlIHVzZXIgc2hvdWxkIGJlIGF3YXJlIHRoYXQgdGhlIHZhbHVlcyBpdCBjb250YWlucyBhcmUgZGVmYXVsdCB2YWx1ZXMgYW5kIAorICogbWlnaHQgYmUgbWVhbmluZ2xlc3MuICBUaGUgdmFsdWVzIG9mIHRoZSBjb3VudGVycyBhcmUgc3RvcmVkIGluIHRoZSBwb2ludGVyIAorICogYWxsb2NhdGVkIGJ5IHRoZSBjbGllbnQuCisgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgKiBAcmV0dXJuIC0gbm9uZQorICogICAgICAgICAgICAgIAorICogQGxpICAgUmVlbnRyYW50ICAgIDogbm8KKyAqIEBsaSAgIElTUiBDYWxsYWJsZSA6IG5vCisgKgorICovICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKK1BVQkxJQyB2b2lkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKK2l4UGVyZlByb2ZBY2NYc2NhbGVQbXVSZXN1bHRzR2V0KEl4UGVyZlByb2ZBY2NYc2NhbGVQbXVSZXN1bHRzICpyZXN1bHRzKTsgICAgCisKKy8qKgorICogQGluZ3JvdXAgSXhQZXJmUHJvZkF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0aCwgc291dGggYnVzIG9yIHNkcmFtIGxhc3QuCisgKiBUaGUgdmFsdWUgcmV0dXJuZWQgYnkgdGhpcyBmdW5jdGlvbiBpcyBhIDMyIGJpdCB2YWx1ZSBhbmQgaXMgcmVhZAorICogZnJvbSBsb2NhdGlvbiBvZiBhbiBvZmZzZXQgMHgwMDI0IG9mIHRoZSBiYXNlIHZhbHVlLgorICoKKyAqIFRoZSBQTVNSIHZhbHVlIHJldHVybmVkIGluZGljYXRlIHRoZSBmb2xsb3dpbmc6CisgKiA8cHJlPgorICoKKyAqICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqICogIEJpdCAgICAqICBOYW1lICAqICAgICAgIERlc2NyaXB0aW9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKKyAqICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogCisgKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAqIFszMToxOF0gICpSZXNlcnZlZCogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAqIFsxNzoxMl0gKiAgUFNTICAgKiBJbmRpY2F0ZXMgd2hpY2ggb2YgdGhlIHNsYXZlcyBvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiAgQVJCUyB3YXMgcHJldmlvdXNseSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBhY2Nlc3NlZCBieSB0aGUgQUhCUy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIAorICogKiAgICAgICAgICogICAgICAgICogWzAwMDAwMV0gRXhwYW5zaW9uIEJ1cyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogKiAgICAgICAgICogICAgICAgICogWzAwMDAxMF0gU0RSQU0gQ29udHJvbGxlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogKiAgICAgICAgICogICAgICAgICogWzAwMDEwMF0gUENJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgorICogKiAgICAgICAgICogICAgICAgICogWzAwMTAwMF0gUXVldWUgTWFuYWdlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAKKyAqICogICAgICAgICAqICAgICAgICAqIFswMTAwMDBdIEFIQi1BUEIgQnJpZGdlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogCisgKiAqICAgICAgICAgKiAgICAgICAgKiBbMTAwMDAwXSBSZXNlcnZlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAqIFsxMTo4XSAgKiAgUFNOICAgKiBJbmRpY2F0ZXMgd2hpY2ggb2YgdGhlIFNsYXZlcyBvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBBUkJOIHdhcyBwcmV2aW91c2x5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBhY2Nlc3NlZCB0aGUgQUhCTi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBbMDAwMV0gU0RSQU0gQ29udHJvbGxlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBbMDAxMF0gQUhCLUFIQiBCcmlkZ2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBbMDEwMF0gUmVzZXJ2ZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBbMTAwMF0gUmVzZXJ2ZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAqICBbNzo0XSAgKiAgUE1TICAgKiBJbmRpY2F0ZXMgd2hpY2ggb2YgdGhlIE1hc3RlcnMgb24gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBBUkJTIHdhcyBwcmV2aW91c2x5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBhY2Nlc3NpbmcgdGhlIEFIQlMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBbMDAwMV0gR2Fza2V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBbMDAxMF0gQUhCLUFIQiBCcmlkZ2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBbMDEwMF0gUENJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBbMTAwMF0gQVBCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAqICBbMzowXSAgKiAgUE1OICAgKiBJbmRpY2F0ZXMgd2hpY2ggb2YgdGhlIE1hc3RlcnMgb24gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBBUkJOIHdhcyBwcmV2aW91c2x5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBhY2Nlc3NpbmcgdGhlIEFIQk4uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBbMDAwMV0gTlBFQSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBbMDAxMF0gTlBFQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBbMDEwMF0gTlBFQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCisgKiAqICAgICAgICAgKiAgICAgICAgKiBbMTAwMF0gUmVzZXJ2ZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCis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KgorICogQGJyaWVmIEhhcmR3YXJlIFFNZ3IgUXVldWUgSUQgZm9yIEhTUyBQb3J0IDEgUGFja2V0aXplZCBUcmFuc21pdCBEb25lIHF1ZXVlCisgKi8KKyNkZWZpbmUgSVhfTlBFX0FfUU1RX0hTUzFfUEtUX1RYX0RPTkUgICBJWF9RTUdSX1FVRVVFXzkKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBRdWV1ZSBhc3NpZ25tZW50cyBmb3IgRE1BCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKyNkZWZpbmUgSVhfRE1BX05QRV9BX1JFUVVFU1RfUUlEIElYX1FNR1JfUVVFVUVfMTkgICAvKio8IFF1ZXVlIElkIGZvciBOUEUgQSBETUEgUmVxdWVzdCAqLworI2RlZmluZSBJWF9ETUFfTlBFX0FfRE9ORV9RSUQgICAgSVhfUU1HUl9RVUVVRV8yMCAgIC8qKjwgUXVldWUgSWQgZm9yIE5QRSBBIERNQSBEb25lICAgICovCisjZGVmaW5lIElYX0RNQV9OUEVfQl9SRVFVRVNUX1FJRCBJWF9RTUdSX1FVRVVFXzI0ICAgLyoqPCBRdWV1ZSBJZCBmb3IgTlBFIEIgRE1BIFJlcXVlc3QgKi8KKyNkZWZpbmUgSVhfRE1BX05QRV9CX0RPTkVfUUlEICAgIElYX1FNR1JfUVVFVUVfMjYgICAvKio8IFF1ZXVlIElkIGZvciBOUEUgQiBETUEgRG9uZSAgICAqLworI2RlZmluZSBJWF9ETUFfTlBFX0NfUkVRVUVTVF9RSUQgSVhfUU1HUl9RVUVVRV8yNSAgIC8qKjwgUXVldWUgSWQgZm9yIE5QRSBDIERNQSBSZXF1ZXN0ICovCisjZGVmaW5lIElYX0RNQV9OUEVfQ19ET05FX1FJRCAgICBJWF9RTUdSX1FVRVVFXzI3ICAgLyoqPCBRdWV1ZSBJZCBmb3IgTlBFIEMgRE1BIERvbmUgICAgKi8KKworCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqIFF1ZXVlIGFzc2lnbm1lbnRzIGZvciBFdGhlcm5ldAorICoKKyAqIE5vdGU6IFJ4IHF1ZXVlIGRlZmluaXRpb25zLCB3aGljaCBpbmNsdWRlIFFvUyB0cmFmZmljIGNsYXNzIGRlZmluaXRpb25zCisgKiBhcmUgbWFuYWdlZCBieSBFdGhEQiBhbmQgZGVjbGFyZWQgaW4gSXhFdGhEQlFvUy5oCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qKgorKgorKiBAZGVmIElYX0VUSF9BQ0NfUlhfRlJBTUVfRVRIX1EgCisqCisqIEBicmllZiAgRXRoMC9FdGgxIE5QRSBGcmFtZSBSZWNpZXZlIFEuCisqCisqIEBub3RlIFRISVMgSVMgTk9UIFVTRUQgLSB0aGUgUnggcXVldWVzIGFyZSByZWFkIGZyb20gRXRoREIgUW9TIGNvbmZpZ3VyYXRpb24KKyogCisqLworI2RlZmluZSBJWF9FVEhfQUNDX1JYX0ZSQU1FX0VUSF9RIAkoSVhfUU1HUl9RVUVVRV80KQorCisvKioKKyoKKyogQGRlZiBJWF9FVEhfQUNDX1JYX0ZSRUVfQlVGRl9FTkVUMF9RCisqCisqIEBicmllZiBTdXBwbHkgUnggQnVmZmVycyBFdGhlcm5ldCBRIGZvciBOUEVCIC0gRXRoIDAgLSBQb3J0IDEKKyoKKyovCisjZGVmaW5lIElYX0VUSF9BQ0NfUlhfRlJFRV9CVUZGX0VORVQwX1EgICAgKElYX1FNR1JfUVVFVUVfMjcpCisK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KyoKKyovCisjZGVmaW5lIElYX0VUSF9BQ0NfVFhfRlJBTUVfRU5FVDJfUSAgICAoSVhfUU1HUl9RVUVVRV8yMykKKworLyoqCisqCisqIEBkZWYgSVhfRVRIX0FDQ19UWF9GUkFNRV9ET05FX0VUSF9RCisqCisqIEBicmllZiBUcmFuc21pdCBjb21wbGV0ZSBRIGZvciBOUEUgRXRoIDAvMSwgUG9ydCAxJjIKKyoKKyovCisjZGVmaW5lIElYX0VUSF9BQ0NfVFhfRlJBTUVfRE9ORV9FVEhfUSAgICAoSVhfUU1HUl9RVUVVRV8zMSkKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBRdWV1ZSBhc3NpZ25tZW50cyBmb3IgQ3J5cHRvCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKy8qKiBDcnlwdG8gU2VydmljZSBSZXF1ZXN0IFF1ZXVlICovCisjZGVmaW5lIElYX0NSWVBUT19BQ0NfQ1JZUFRPX1JFUV9RICAoSVhfUU1HUl9RVUVVRV8yOSkKKworLyoqIENyeXB0byBTZXJ2aWNlIERvbmUgUXVldWUgKi8KKyNkZWZpbmUgSVhfQ1JZUFRPX0FDQ19DUllQVE9fRE9ORV9RIChJWF9RTUdSX1FVRVVFXzMwKQorCisvKiogQ3J5cHRvIFJlcSBRIENCIHRhZyAqLworI2RlZmluZSBJWF9DUllQVE9fQUNDX0NSWVBUT19SRVFfUV9DQl9UQUcgICAoMCkKKworLyoqIENyeXB0byBEb25lIFEgQ0IgdGFnICovCisjZGVmaW5lIElYX0NSWVBUT19BQ0NfQ1JZUFRPX0RPTkVfUV9DQl9UQUcgICgxKQorCisvKiogV0VQIFNlcnZpY2UgUmVxdWVzdCBRdWV1ZSAqLworI2RlZmluZ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GlzIEFQSSB3aWxsIHJldHVybiB0aGUgc3RhdGlzdGljcyBjb3VudGVycyBvZiB0aGUgU1NQIHRyYW5zZmVycy4KKyAqCisgKiBAcmV0dXJuIAorICogICAgICAtIElYX1NTUF9TVUNDRVNTIC0gU3RhdHMgb2J0YWluZWQgaW50byB0aGUgcG9pbnRlciBwcm92aWRlZCBzdWNjZXNzZnVsbHkKKyAqCQktIElYX1NTUF9GQUlMIC0gY2xpZW50IHByb3ZpZGVkIHBvaW50ZXIgaXMgTlVMTAorICogICAgICAgICAgICAgIAorICogQGxpICAgUmVlbnRyYW50ICAgIDogeWVzCisgKiBAbGkgICBJU1IgQ2FsbGFibGUgOiB5ZXMKKyAqCisgKi8KK1BVQkxJQyBJWF9TU1BfU1RBVFVTCitpeFNzcEFjY1N0YXRzR2V0ICgKKwlJeFNzcEFjY1N0YXRzQ291bnRlcnMgKnNzcFN0YXRzKTsKKworLyoqCisgKiBAaW5ncm91cCBJeFNzcEFjYworICogCisgKiBAZm4gaXhTc3BBY2NTdGF0c1Jlc2V0ICgKKwl2b2lkKQorICoKKyAqIEBicmllZiBSZXNldHMgdGhlIFNTUCBTdGF0aXN0aWNzCisgKgorICogQHBhcmFtIC0gTm9uZQorICoKKyAqIEdsb2JhbCBEYXRhCToKKyAqCQktIE5vbmUuCisgKiAgICAgICAgICAgICAgICAgICAgICAgIAorICogVGhpcyBBUEkgd2lsbCByZXNldCB0aGUgU1NQIHN0YXRpc3RpY3MgY291bnRlcnMuCisgKgorICogQHJldHVybiAKKyAqICAgICAgLSBOb25lCisgKiAgICAgICAgICAgICAgCisgKiBAbGkgICBSZWVudHJhbnQgICAgOiB5ZXMKKyAqIEBsaSAgIElTUiBDYWxsYWJsZSA6IHllcworICoKKyAqLworUFVCTElDIHZvaWQKK2l4U3NwQWNjU3RhdHNSZXNldCAoCisJdm9pZCk7CisKKy8qKgorICogQGluZ3JvdXAgSXhTc3BBY2MKKyAqIAorICogQGZuIGl4U3NwQWNjU2hvdyAoC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b3IKKyAqIGlkbGUKKyAqCisgKiBAcmV0dXJuIAorICogICAgICAtIElYX1NTUF9CVVNZIC0gU1NQIGlzIGJ1c3kKKyAqCQktIElYX1NTUF9JRExFIC0gU1NQIGlzIGlkbGUuCisgKgkJLSBJWF9TU1BfTk9UX0lOSVQgLSBTU1Agbm90IGluaXRpYWxpemVkLiBTU1AgaW5pdCBuZWVkcyB0byBiZSBjYWxsZWQuCisgKiAgICAgICAgICAgICAgCisgKiBAbGkgICBSZWVudHJhbnQgICAgOiB5ZXMKKyAqIEBsaSAgIElTUiBDYWxsYWJsZSA6IHllcworICoKKyAqLworUFVCTElDIElYX1NTUF9TVEFUVVMKK2l4U3NwQWNjU1NQQnVzeUNoZWNrICgKKwl2b2lkKTsKKworLyoqCisgKiBAaW5ncm91cCBJeFNzcEFjYworICogCisgKiBAZm4gaXhTc3BBY2NUeEZJRk9MZXZlbEdldCAoCisJCXZvaWQpCisgKgorICogQGJyaWVmIE9idGFpbiB0aGUgVHggRklGTydzIGxldmVsCisgKgorICogQHBhcmFtIC0gTm9uZQorICoKKyAqIEdsb2JhbCBEYXRhCToKKyAqCQktIE5vbmUuCisgKiAgICAgICAgICAgICAgICAgICAgICAgIAorICogVGhpcyBBUEkgd2lsbCByZXR1cm4gdGhlIGxldmVsIG9mIHRoZSBUeCBGSUZPCisgKgorICogQHJldHVybiAKKyAqICAgICAgLSAwLi4xNjsgMCBjYW4gYWxzbyBtZWFuIFNTUCBub3QgaW5pdGlhbGl6ZWQgYW5kIHdpbGwgbmVlZCB0byBiZSBpbml0LgorICogICAgICAgICAgICAgIAorICogQGxpICAgUmVlbnRyYW50ICAgIDogeWVzCisgKiBAbGkgICBJU1IgQ2FsbGFibGUgOiB5ZXMKKyAqCisgKi8KK1BVQkxJQyBVSU5UOAoraXhTc3BBY2NUeEZJRk9MZXZlbEdldCAoCisJdm9pZCk7CisKKy8qKgorICogQGluZ3JvdXAgSXhTc3BBY2MKKyAqIAorICogQGZuIGl4U3NwQWNj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U0laRQorI2VuZGlmCisjZGVmaW5lIENTSVpFCQkweGMKKworLyoqCisgKiBAaW5ncm91cCBJb2N0bEFyZ0RlZmluZXMKKyAqCisgKiBAZGVmIENTNQorICoKKyAqIEBicmllZiA1IGJpdHMKKyAqLworI2lmZGVmIENTNQorI3VuZGVmIENTNQorI2VuZGlmCisjZGVmaW5lIENTNQkJMHgwCisKKy8qKgorICogQGluZ3JvdXAgSW9jdGxBcmdEZWZpbmVzCisgKgorICogQGRlZiBDUzYKKyAqCisgKiBAYnJpZWYgNiBiaXRzCisgKi8KKyNpZmRlZiBDUzYKKyN1bmRlZiBDUzYKKyNlbmRpZgorI2RlZmluZSBDUzYJCTB4NAorCisvKioKKyAqIEBpbmdyb3VwIElvY3RsQXJnRGVmaW5lcworICoKKyAqIEBkZWYgQ1M3CisgKgorICogQGJyaWVmIDcgYml0cworICovCisjaWZkZWYgQ1M3CisjdW5kZWYgQ1M3CisjZW5kaWYKKyNkZWZpbmUgQ1M3CQkweDgKKworLyoqCisgKiBAaW5ncm91cCBJb2N0bEFyZ0RlZmluZXMKKyAqCisgKiBAZGVmIENTOAorICoKKyAqIEBicmllZiA4IGJpdHMKKyAqLworI2lmZGVmIENTOAorI3VuZGVmIENTOAorI2VuZGlmCisjZGVmaW5lIENTOAkJMHhjCisKKy8qKgorICogQGluZ3JvdXAgSW9jdGxBcmdEZWZpbmVzCisgKgorICogQGRlZiBTVE9QQgorICoKKyAqIEBicmllZiBTZW5kIHR3byBzdG9wIGJpdHMgKGVsc2Ugb25lKQorICovCisjZGVmaW5lIFNUT1BCCQkweDIwCisKKy8qKgorICogQGluZ3JvdXAgSW9jdGxBcmdEZWZpbmVzCisgKgorICogQGRlZiBQQVJFTkIKKyAqCisgKiBAYnJpZWYgUGFyaXR5IGRldGVjdGlvbiBlbmFibGVkIChlbHNlIGRpc2FibGVkKQorICovCisjaWZkZWYgUEFSRU5CCisjdW5kZWYgUEFSRU5CCisjZW5kaWYKKyNkZWZpbmUgUEFSRU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aW9uIHNob3VsZCBvbmx5IGJlIGNhbGxlZCBvbmNlIHBlciBkZXZpY2UuCisgKgorICogQHJldHZhbCBJWF9TVUNDRVNTIC0gVUFSVCBkZXZpY2Ugc3VjY2Vzc2Z1bGx5IGluaXRpYWxpc2VkLgorICogQHJldHZhbCBJWF9GQUlMIC0gQ3JpdGljYWwgZXJyb3IsIGRldmljZSBub3QgaW5pdGlhbGlzZWQuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworUFVCTElDIElYX1NUQVRVUyBpeFVBUlRJbml0KGl4VUFSVERldiogcFVBUlQpOworCisvKioKKyAqIEBpbmdyb3VwIEl4VUFSVEFjY0FQSQorICoKKyAqIEBmbiBJWF9TVEFUVVMgaXhVQVJUUG9sbE91dHB1dChpeFVBUlREZXYqIHBVQVJULCBpbnQgb3V0Q2hhcikKKyAqCisgKiBAcGFyYW0gcFVBUlQgQHJlZiBpeFVBUlREZXYgW291dF0gLSBwb2ludGVyIHRvIFVBUlQgc3RydWN0dXJlIGRlc2NyaWJpbmcgb3VyIGRldmljZS4KKyAqIEBwYXJhbSBvdXRDaGFyIGludCBbb3V0XSAtIGNoYXJhY3RlciB0byB0cmFuc21pdC4KKyAqCisgKiBAYnJpZWYgVHJhbnNtaXQgYSBjaGFyYWN0ZXIgaW4gcG9sbGVkIG1vZGUuCisgKgorICogQHByZSBVQVJUIGRldmljZSBtdXN0IGJlIGluaXRpYWxpc2VkLgorICoKKyAqIEByZXR2YWwgSVhfU1VDQ0VTUyAtIGNoYXJhY3RlciB3YXMgc3VjY2Vzc2Z1bGx5IHRyYW5zbWl0dGVkLgorICogQHJldHZhbCBJWF9GQUlMIC0gb3V0cHV0IGJ1ZmZlciBpcyBmdWxsICh0cnkgYWdhaW4pLgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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ICAgICBpeF9lcnJvci5oIChSZXBsYWNlZCBieSBPU0FMKQorICoKKyAqID0gREVTQ1JJUFRJT04KKyAqICAgICAgVGhpcyBmaWxlIHdpbGwgZGVzY3JpYmUgdGhlIGJhc2ljIGVycm9yIHR5cGUgYW5kIHN1cHBvcnQgZnVuY3Rpb25zIHRoYXQKKyAqICAgICAgd2lsbCBiZSB1c2VkIGJ5IHRoZSBJWEEgU0RLIEZyYW1ld29yayBBUEkuCisgKgorICogPSBBVVRIT1IKKyAqICAgICAgSW50ZWwgQ29ycG9yYXRpb24KKyAqCisgKiA9IENIQU5HRSBISVNUT1JZCisgKiAgICAgIDQvMjIvMjAwMiA0OjE5OjAzIFBNIC0gY3JlYXRpb24gdGltZSAKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqLworCisjaWYgIWRlZmluZWQoX19JWF9FUlJPUl9IX18pCisjZGVmaW5lIF9fSVhfRVJST1JfSF9fCisKKyNpbmNsdWRlICJJeE9zYWxCYWNrd2FyZC5oIgorCisjZW5kaWYgLyogZW5kICFkZWZpbmVkKF9fSVhfRVJST1JfSF9fKSAqLworCmRpZmYgLS1naXQgYS9jcHUvaXhwL25wZS9pbmNsdWRlL2l4X21hY3Jvcy5oIGIvY3B1L2l4cC9ucGUvaW5jbHVkZS9peF9tYWNyb3MuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi41M2Y1OTQyCi0tLSAvZGV2L251bGwKKysrIGIvY3B1L2l4cC9ucGUvaW5jbHVkZS9peF9tYWNyb3MuaApAQCAtMCwwICsxLDI2NiBAQAorLyoqCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiA9IENPUFlSSUdIVAorICogCisgKiBAcGFyCisgKiBJWFA0MDAgU1cgUmVsZWFzZS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FSRSwgRVZFTiBJRiBBRFZJU0VEIE9GIFRIRSBQT1NTSUJJTElUWSBPRgorICogU1VDSCBEQU1BR0UuCisgKiAKKyAqIEBwYXIKKyAqIC0tIEVuZCBvZiBDb3B5cmlnaHQgTm90aWNlIC0tCisgKiA9IFBST0RVQ1QKKyAqICAgICAgSW50ZWwocikgSVhQNDI1IFNvZnR3YXJlIFJlbGVhc2UKKyAqCisgKiA9IEZJTEVOQU1FCisgKiAgICAgIGl4X21hY3Jvcy5oCisgKgorICogPSBERVNDUklQVElPTgorICogICAgICBUaGlzIGZpbGUgd2lsbCBkZWZpbmUgdGhlIGJhc2ljIHByZXByb2Nlc3NvciBtYWNyb3MgdGhhdCBhcmUgZ29pbmcgdG8gYmUgdXNlZAorICogICAgICB0aGUgSVhBIFNESyBGcmFtZXdvcmsgQVBJLgorICoKKyAqID0gQVVUSE9SCisgKiAgICAgIEludGVsIENvcnBvcmF0aW9uCisgKgorICogPSBDSEFOR0UgSElTVE9SWQorICogICAgICA0LzIyLzIwMDIgNDo0MTowNSBQTSAtIGNyZWF0aW9uIHRpbWUgCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKi8KKworI2lmICFkZWZpbmVkKF9fSVhfTUFDUk9TX0hfXykKKyNkZWZpbmUgX19JWF9NQUNST1NfSF9fCisKKworI2lmIGRlZmluZWQoX19jcGx1c3BsdXMpCitleHRlcm4gIkMiCit7CisjZW5kaWYgLyogZW5kIGRlZmluZWQoX19jcGx1c3BsdXMpICovCisKKworLyoqCisgKiBNQUNSTyBOQU1FOiBJWF9CSVRfRklFTERfTUFTSzE2CisgKgorICogREVTQ1JJUFRJT046IEJ1aWxkcyB0aGUgbWFzayByZXF1aXJlZCB0byBleHRyYWN0IHRoZSBiaXQgZmllbGQgZnJvbSBhIDE2IGJpdCB1bnNpZ25lZCBpbnRlZ2VyIHZhbHVlLgorICoKKyAqIEB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gZnJvbSAwIHRvIAorICogICAgICAgICAgKDEgPDwgKGFyZ19GaWVsZE1TQkJpdCArIDEgLSBhcmdfRmllbGRMU0JCaXQpKSAtIDEuCisgKiBAUGFyYW06ICAtIElOIGFyZ19GaWVsZExTQkJpdCBhbiB1bnNpZ25lZCBpbnRlZ2VyIHZhbHVlIHJlcHJlc2VudGluZyB0aGUgcG9zaXRpb24gb2YgdGhlIGxlYXN0IHNpZ25pZmljYW50CisgKiAgICAgICAgICBiaXQgb2YgdGhlIGJpdCBmaWVsZC4KKyAqIEBQYXJhbTogIC0gSU4gYXJnX0ZpZWxkTVNCQml0IGFuIHVuc2lnbmVkIGludGVnZXIgdmFsdWUgcmVwcmVzZW50aW5nIHRoZSBwb3NpdGlvbiBvZiB0aGUgbW9zdCBzaWduaWZpY2FudAorICogICAgICAgICAgYml0IG9mIHRoZSBiaXQgZmllbGQuCisgKgorICogQFJldHVybjogUmV0dXJucyB0aGUgdXBkYXRlZCB2YWx1ZSBvZiBhcmdfUGFja2VkRGF0YTE2LgorICovCisjZGVmaW5lIElYX1NFVF9CSVRfRklFTEQxNiggXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ19QYWNrZWREYXRhMTYsIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdfQml0RmllbGRWYWx1ZSwgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ19GaWVsZExTQkJpdCwgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ19GaWVsZE1TQkJpdCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICkgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAoYXJnX1BhY2tlZERhdGExNiA9ICgoKGl4X3VpbnQxNikoYXJnX1BhY2tlZERhdGExNikgJiBcCisgICAgICAgICAgICAgICAgICAgICAgICAgIH4oSVhfQklUX0ZJRUxEX01BU0sxNihhcmdfRmllbGRMU0JCaXQsIGFyZ19GaWVsZE1TQkJpdCkpKSB8IFwK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hbiBiZSBmcm9tIDAgdG8gKDEgPDwgKGFyZ19GaWVsZE1TQkJpdCArIDEgLQorICogICAgICAgICAgYXJnX0ZpZWxkTFNCQml0KSkgLSAxLgorICovCisjZGVmaW5lIElYX0dFVF9CSVRfRklFTEQzMiggXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ19QYWNrZWREYXRhMzIsIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdfRmllbGRMU0JCaXQsIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdfRmllbGRNU0JCaXQgXAorICAgICAgICAgICAgICAgICAgICAgICAgICApIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKCgoaXhfdWludDMyKShhcmdfUGFja2VkRGF0YTMyKSAmIElYX0JJVF9GSUVMRF9NQVNLMzIoYXJnX0ZpZWxkTFNCQml0LCBhcmdfRmllbGRNU0JCaXQpKSA+PiBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ19GaWVsZExTQkJpdCkKKworCisKKworLyoqCisgKiBNQUNSTyBOQU1FOiBJWF9NQUtFX0JJVF9GSUVMRDMyCisgKgorICogREVTQ1JJUFRJT046IFRoaXMgbWFjcm8gd2lsbCBjcmVhdGUgYSB0ZW1wb3JhcnkgMzIgYml0IHZhbHVlIHdpdGggdGhlIGJpdCBmaWVsZAorICogICAgICAgICAgZGVzaXJlZCBzZXQgdG8gdGhlIGRlc2lyZWQgdmFsdWUuCisgKgorICogQFBhcmFtOiAgLSBJTiBhcmdfQml0RmllbGRWYWx1ZSBpcyB0aGUgbmV3IHZhbHVlIG9mIHRoZSBiaXQgZmllbGQuIFRoZSB2YWx1ZSBjYW4gYmUgZnJvbSAwIHRvIAorICogICAgICAgICAgKDEgPDwgKGFyZ19GaWVsZE1TQkJpdCArIDEgLSBhcmdfRmllbGRMU0JCaXQpKSAtIDEuCisgKiBAUGFyYW06ICAtIElOIGFyZ19GaWVsZExTQkJpdCBhbiB1bnNpZ25lZCBpbnRlZ2VyIHZhbHVlIHJlcHJlc2VudGluZyB0aGUgcG9zaXRpb24gb2YgdGhlIGxlYXN0IHNpZ25pZmljYW50CisgKiAgICAgICAgICBiaXQgb2YgdGhlIGJpdCBmaWVsZC4KKyAqIEBQYXJhbTogIC0gSU4gYXJnX0ZpZWxkTVNCQml0IGFuIHVuc2lnbmVkIGludGVnZXIgdmFsdWUgcmVwcmVzZW50aW5nIHRoZSBwb3NpdGlvbiBvZiB0aGUgbW9zdCBzaWduaWZpY2FudAorICogICAgICAgICAgYml0IG9mIHRoZSBiaXQgZmllbGQuCisgKiAKKyAqIEBSZXR1cm46IFJldHVybnMgYSB0ZW1wb3JhcnkgaXhfdWludDMyIHZhbHVlIHRoYXQgaGFzIHRoZSBiaXQgZmllbGQgc2V0IHRvIHRoZSBhcHByb3ByaWF0ZSB2YWx1ZS4KKyAqLworI2RlZmluZSBJWF9NQUtFX0JJVF9GSUVMRDMyKCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ19CaXRGaWVsZFZhbHVlLCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ19GaWVsZExTQkJpdCwgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdfRmllbGRNU0JCaXQgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgKSBcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChpeF91aW50MzIpKGFyZ19CaXRGaWVsZFZhbHVlKSA8PCBhcmdfRmllbGRMU0JCaXQpICYgXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgSVhfQklUX0ZJRUxEX01BU0szMihhcmdfRmllbGRMU0JCaXQsIGFyZ19GaWVsZE1TQkJpdCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorLyoqCisgKiBNQUNSTyBOQU1FOiBJWF9TRVRfQklUX0ZJRUxEMzIKKyAqCisgKiBERVNDUklQVElPTjogU2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dWUsIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdfRmllbGRMU0JCaXQsIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdfRmllbGRNU0JCaXQgXAorICAgICAgICAgICAgICAgICAgICAgICAgICApIFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgKGFyZ19QYWNrZWREYXRhMzIgPSAoKChpeF91aW50MzIpKGFyZ19QYWNrZWREYXRhMzIpICYgXAorICAgICAgICAgICAgICAgICAgICAgICAgICB+KElYX0JJVF9GSUVMRF9NQVNLMzIoYXJnX0ZpZWxkTFNCQml0LCBhcmdfRmllbGRNU0JCaXQpKSkgfCBcCisgICAgICAgICAgICAgICAgICAgICAgICAgIElYX01BS0VfQklUX0ZJRUxEMzIoYXJnX0JpdEZpZWxkVmFsdWUsIGFyZ19GaWVsZExTQkJpdCwgYXJnX0ZpZWxkTVNCQml0KSkpIAorCisKKworI2lmIGRlZmluZWQoX19jcGx1c3BsdXMpCit9CisjZW5kaWYgLyogZW5kIGRlZmluZWQoX19jcGx1c3BsdXMpICovCisKKyNlbmRpZiAvKiBlbmQgIWRlZmluZWQoX19JWF9NQUNST1NfSF9fKSAqLwpkaWZmIC0tZ2l0IGEvY3B1L2l4cC9ucGUvaW5jbHVkZS9peF9vc190eXBlLmggYi9jcHUvaXhwL25wZS9pbmNsdWRlL2l4X29zX3R5cGUuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi44NTc1MDk2Ci0tLSAvZGV2L251bGwKKysrIGIvY3B1L2l4cC9ucGUvaW5jbHVkZS9peF9vc190eXBlLmgKQEAgLTAsMCArMSw2NSBAQAorLyoqCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiA9IENPUFlSSUdIVAorICogCisgKiBAcGFyCisgKiBJWFA0MDAgU1cgUmVsZWFzZSB2ZXJzaW9uID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sX3RocmVhZF9nZXRfaWQKKyAqICAgICAgICAgICAgIGl4X29zc2xfdGhyZWFkX2V4aXQKKyAqICAgICAgICAgICAgIGl4X29zc2xfdGhyZWFkX2tpbGwKKyAqICAgICAgICAgICAgIGl4X29zc2xfdGhyZWFkX3NldF9wcmlvcml0eQorICogICAgICAgICAgICAgaXhfb3NzbF90aHJlYWRfX2RlbGF5CisgKiAKKyAqICAgT1NTTCBTZW1hcGhvcmUgQVBJczoKKyAqICAgICAgICAgICAgIFRoZSBPU1NMIHNlbWFwaG9yZSBmdW5jdGlvbnMgdGhhdCBhbGxvdyBmb3IgaW5pdGlhbGl6YXRpb24sCisgKiAgICAgICAgICAgICBwb3N0aW5nLCB3YWl0aW5nIGFuZCBkZWxldGlvbiBvZiBzZW1hcGhvcmVzLgorICoKKyAqICAgICAgICAgICAgIGl4X29zc2xfc2VtX2luaXQKKyAqICAgICAgICAgICAgIGl4X29zc2xfc2VtX2ZpbmkKKyAqICAgICAgICAgICAgIGl4X29zc2xfc2VtX3Rha2UKKyAqICAgICAgICAgICAgIGl4X29zc2xfc2VtX2dpdmUKKyAqICAgICAgICAgICAgIGl4X29zc2xfc2VtX2ZsdXNoCisgKgorICogICBPU1NMIE11dGV4IEFQSXM6CisgKiAgICAgICAgICAgICBUaGUgT1NTTCB3cmFwcGVyIGZ1bmN0aW9ucyB0aGF0IGFsbG93IGZvciBpbml0aWFsaXphdGlvbiwKKyAqICAgICAgICAgICAgIHBvc3RpbmcsIHdhaXRpbmcgYW5kIGRlbGV0aW9uIG9mIG11dGV4ZXMuCisgKgorICogICAgICAgICAgICAgaXhfb3NzbF9tdXRleF9pbml0CisgKiAgICAgICAgICAgICBpeF9vc3NsX211dGV4X2ZpbmkKKyAqICAgICAgICAgICAgIGl4X29zc2xfbXV0ZXhfbG9jaworICogICAgICAgICAgICAgaXhfb3NzbF9tdXRleF91bmxvY2sKKyAqCisgKiAgIE9TU0wgVGltZXIgQVBJczoKKyAqICAgICAJICAgICAgIFRoZSB0aW1lciBBUElzIHByb3ZpZGUgc2xlZXAgYW5kIGdldCB0aW1lIGZ1bmN0aW9ucy4KKyAqCisgKiAgICAgICAgICAgICBpeF9vc3NsX3NsZWVwCisgKiAgICAgICAgICAgICBpeF9vc3NsX3NsZWVwX3RpY2sKKyAqICAgICAgICAgICAgIGl4X29zc2xfdGltZV9nZXQKKyAqIAorICogICBPU0FQSXMgZm9yIFRyYW5zYWN0b3IvV29ya0JlbmNoOgorICogICAgICAgICAgICAgVGhlc2UgT1NBUEkgZnVuY3Rpb25zIGFyZSB1c2VkIGZvciB0cmFuc2F0b3IgT1MgY2FsbHMuIAorICogICAgICAgICAgICAgVGhleSBhcmUgZGVmaW5lZCBpbiBvc0FwaS5oLiAKKyAqCisgKiAgICAgICAgICAgICBTZW1fSW5pdCAJCQkKKyAqICAgICAgICAgICAgIFNlbV9EZXN0cm95IAkJCisgKiAgICAgICAgICAgICBTZW1fV2FpdCAJCQkKKyAqICAgICAgICAgICAgIFNlbV9XYWl0CQkJCisgKiAgICAgICAgICAgICBUaHJlYWRfQ3JlYXRlCQkKKyAqICAgICAgICAgICAgIFRocmVhZF9DYW5jZWwgCQkKKyAqICAgICAgICAgICAgIFRocmVhZF9TZXRQcmlvcml0eSAJCQorICogICAgICAgICAgICAgZGVsYXlNcyAJCQkKKyAqICAgICAgICAgICAgIGRlbGF5VGljawkJCQorICogICAgICAgICAgICAgCisgKgorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiAgICAgIAorICoKKyAqID0gQVVUSE9SCisgKiAgICAgIEludGVsIENvcnBvcmF0aW9uCisgKgorICogPSBBQ0tOT1dMRURHRU1FTlRTCisgKiAgICAgIAorICoKKyAqID0gQ1JFQVRJT04gVElNRQorICogICAgICAxLzgvMjAwMiAxOjUzOjQyIFBNCisgKgorICogPSBDSEFOR0UgSElTVE9SWQorICogICAwMi8yMi8yMDAyIDogUmVuYW1lZCBvc2FwaS5oIG9zX2FwaS5oCisgKiAgICAgICAgICAgICAgICBNb3ZlZCBPUyBoZWFkZXIgZmlsZSBpbmNsdWRlcyBmcm9tIE9TU0wuaCB0byBvc19hcGkuaAorICogICAgICAgICAgICAgICAgTW92ZWQgT1Mgc3BlY2lmaWMgZGF0YXR5cGVzIHRvIG9zX2FwaS5oIAorICogICAgICAgICAgICAgICAgTW9kaWZpZWQgZGF0YSB0eXBlcywgbWFjcm9zIGFuZCBmdW5jdGlvbnMgYXMgcGVyCisgKiAgICAgICAgICAgICAgICAnQycgY29kaW5nIGd1aWRlbGluZXMuCisgKgorICoKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqLworCisjaWZuZGVmIF9JWF9PU1NMX0gKKyNpZm5kZWYgX19kb3h5Z2VuX2hpZGUKKyNkZWZpbmUgX0lYX09TU0xfSAorI2VuZGlmIC8qIF9fZG94eWdlbl9oaWRlICovCisKKyNpbmNsdWRlICJJeE9zYWxCYWNrd2FyZC5oIgorIAorI2VuZGlmIC8qIF9JWF9PU1NMX0ggKi8KKworLyoqCisgKiBAfSBkZWZncm91cCBJeE9TU0wKKyAqLwpkaWZmIC0tZ2l0IGEvY3B1L2l4cC9ucGUvaW5jbHVkZS9peF9zeW1ib2xzLmggYi9jcHUvaXhwL25wZS9pbmNsdWRlL2l4X3N5bWJvbHMuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5mN2JiMDI5Ci0tLSAvZGV2L251bGwKKysrIGIvY3B1L2l4cC9ucGUvaW5jbHVkZS9peF9zeW1ib2xzLmgKQEAgLTAsMCArMSwxMDYgQEAKKy8qKgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogPSBDT1BZUklHSFQKKyAqIAorICogQHBh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qICAgICAgSW50ZWwocikgSVhQNDI1IFNvZnR3YXJlIFJlbGVhc2UKKyAqCisgKiA9IEZJTEVOQU1FCisgKiAgICAgIGl4X3R5cGVzLmgKKyAqCisgKiA9IERFU0NSSVBUSU9OCisgKiAgICAgIFRoaXMgZmlsZSB3aWxsIGRlZmluZSBnZW5lcmljIHR5cGVzIHRoYXQgd2lsbCBndWFyYW50ZWUgdGhlIHByb3RhYmlsaXR5CisgKiAgICAgIGJldHdlZW4gZGlmZmVyZW50IGFyY2hpdGVjdHVyZXMgYW5kIGNvbXBpbGVycy4gSXQgc2hvdWxkIGJlIHVzZWQgdGhlIGVudGlyZQorICogICAgICBJWEEgU0RLIEZyYW1ld29yayBBUEkuCisgKgorICogPSBBVVRIT1IKKyAqICAgICAgSW50ZWwgQ29ycG9yYXRpb24KKyAqCisgKiA9IENIQU5HRSBISVNUT1JZCisgKiAgICAgIDQvMjIvMjAwMiA0OjQ0OjE3IFBNIC0gY3JlYXRpb24gdGltZSAKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqLworCisjaWYgIWRlZmluZWQoX19JWF9UWVBFU19IX18pCisjZGVmaW5lIF9fSVhfVFlQRVNfSF9fCisKKworI2lmIGRlZmluZWQoX19jcGx1c3BsdXMpCitleHRlcm4gIkMiCit7CisjZW5kaWYgLyogZW5kIGRlZmluZWQoX19jcGx1c3BsdXMpICovCisKKworLyoqCisgKiBEZWZpbmUgZ2VuZXJpYyBpbnRlZ3JhbCBkYXRhIHR5cGVzIHRoYXQgd2lsbCBndWFyYW50ZWUgdGhlIHNpemUuCisgKi8KKworLyoqCisgKiBUWVBFTkFNRTogaXhfaW50OAorICogCisgKiBERVNDUklQVElPTjogVGhpcyB0eXBlIGRlZmluZXMgYW4gOCBiaXQgc2lnbmVkIGludGVnZXIgdmFsdWUuCisgKgorICovCit0eXBlZGVmIHNpZ25lZCBjaGFyIG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W50NjQKKyAqIAorICogREVTQ1JJUFRJT046IFRoaXMgdHlwZSBkZWZpbmVzIGFuIDY0IGJpdCBzaWduZWQgaW50ZWdlciB2YWx1ZS4KKyAqCisgKi8KKyNpZm5kZWYgX193aW5jZQorX19leHRlbnNpb25fXyB0eXBlZGVmIHNpZ25lZCBsb25nIGxvbmcgaW50IGl4X2ludDY0OworI2VuZGlmCisKKy8qKgorICogVFlQRU5BTUU6IGl4X3VpbnQ2NAorICogCisgKiBERVNDUklQVElPTjogVGhpcyB0eXBlIGRlZmluZXMgYW4gNjQgYml0IHVuc2lnbmVkIGludGVnZXIgdmFsdWUuCisgKgorICovCisjaWZuZGVmIF9fd2luY2UKK19fZXh0ZW5zaW9uX18gdHlwZWRlZiB1bnNpZ25lZCBsb25nIGxvbmcgaW50IGl4X3VpbnQ2NDsKKyNlbmRpZgorCisKKy8qKgorICogVFlQRU5BTUU6IGl4X2JpdF9tYXNrOAorICogCisgKiBERVNDUklQVElPTjogVGhpcyBpcyBhIGdlbmVyaWMgdHlwZSBmb3IgYSA4IGJpdCBtYXNrLiAKKyAqLwordHlwZWRlZiBpeF91aW50OCBpeF9iaXRfbWFzazg7CisKKworLyoqCisgKiBUWVBFTkFNRTogaXhfYml0X21hc2sxNgorICogCisgKiBERVNDUklQVElPTjogVGhpcyBpcyBhIGdlbmVyaWMgdHlwZSBmb3IgYSAxNiBiaXQgbWFzay4gCisgKi8KK3R5cGVkZWYgaXhfdWludDE2IGl4X2JpdF9tYXNrMTY7CisKKworLyoqCisgKiBUWVBFTkFNRTogaXhfYml0X21hc2szMgorICogCisgKiBERVNDUklQVElPTjogVGhpcyBpcyBhIGdlbmVyaWMgdHlwZSBmb3IgYSAzMiBiaXQgbWFzay4gCisgKi8KK3R5cGVkZWYgaXhfdWludDMyIGl4X2JpdF9tYXNrMzI7CisKKworLyoqCisgKiBUWVBFTkFNRTogaXhfYml0X21hc2s2NAorICogCisgKiBERVNDUklQVElPTjogVGhpcyBpcyBhIGdlbmV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gYmlfZW5ldDFhZGRyWzZdOworI2VuZGlmCiB9IGJkX3Q7CiAKICNkZWZpbmUgYmlfZW52X2RhdGEgYmlfZW52LT5kYXRhCmRpZmYgLS1naXQgYS9pbmNsdWRlL2NvbmZpZ3MvaXhkcDQyNS5oIGIvaW5jbHVkZS9jb25maWdzL2l4ZHA0MjUuaAppbmRleCBiMGE4MGEzLi45ZjlmZGIyIDEwMDY0NAotLS0gYS9pbmNsdWRlL2NvbmZpZ3MvaXhkcDQyNS5oCisrKyBiL2luY2x1ZGUvY29uZmlncy9peGRwNDI1LmgKQEAgLTMzLDYgKzMzLDkgQEAKICNkZWZpbmUgQ09ORklHX0lYUDQyNSAgICAgICAgICAgMSAgICAgICAvKiBUaGlzIGlzIGFuIElYUDQyNSBDUFUgICAgKi8KICNkZWZpbmUgQ09ORklHX0lYRFA0MjUgICAgICAgICAgMSAgICAgICAvKiBvbiBhbiBJWERQNDI1IEJvYXJkICAgICAgKi8KIAorI2RlZmluZSBDT05GSUdfRElTUExBWV9DUFVJTkZPCTEJLyogZGlzcGxheSBjcHUgaW5mbyAoYW5kIHNwZWVkKQkqLworI2RlZmluZSBDT05GSUdfRElTUExBWV9CT0FSRElORk8gMQkvKiBkaXNwbGF5IGJvYXJkIGluZm8JCSovCisKIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICAqIFUtYm9vdCBnZW5lcmljIGRlZmluZXMgc3RhcnQgaGVyZS4KICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCkBAIC0xMzUsNiArMTM4LDggQEAKICNkZWZpbmUgQ0ZHX0RSQU1fU0laRSAgICAgICAgICAgMHgwMTAwMDAwMAogCiAjZGVmaW5lIENGR19GTEFTSF9CQVNFICAgICAgICAgIFBIWVNfRkxBU0hfMQorI2RlZmluZSBDRkdfTU9OSVRPUl9CQVNFCUNGR19GTEFTSF9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NkZWZpbmUgQ0ZHX0JBVURSQVRFX1RBQkxFICAgICAgeyA5NjAwLCAxOTIwMCwgMzg0MDAsIDU3NjAwLCAxMTUyMDAgfQorCisvKgorICogU3RhY2sgc2l6ZXMKKyAqCisgKiBUaGUgc3RhY2sgc2l6ZXMgYXJlIHNldCB1cCBpbiBzdGFydC5TIHVzaW5nIHRoZSBzZXR0aW5ncyBiZWxvdworICovCisjZGVmaW5lIENPTkZJR19TVEFDS1NJWkUgICAgICAgICgxMjgqMTAyNCkgICAgICAvKiByZWd1bGFyIHN0YWNrICovCisjaWZkZWYgQ09ORklHX1VTRV9JUlEKKyNkZWZpbmUgQ09ORklHX1NUQUNLU0laRV9JUlEgICAgKDQqMTAyNCkgICAgICAgIC8qIElSUSBzdGFjayAqLworI2RlZmluZSBDT05GSUdfU1RBQ0tTSVpFX0ZJUSAgICAoNCoxMDI0KSAgICAgICAgLyogRklRIHN0YWNrICovCisjZW5kaWYKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICogUGxhdGZvcm0vQm9hcmQgc3BlY2lmaWMgZGVmaW5lcyBzdGFydCBoZXJlLgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICogRGVmYXVsdCBjb25maWd1cmF0aW9uIChlbnZpcm9ubWVudCB2YXJpYmxlcy4uLikKKyAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCisjZGVmaW5lIENPTkZJR19QUkVCT09UCSJlY2hvOyIJXAorCSJlY2hvIFR5cGUgXCJydW4gZmxhc2hfbmZzX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CisvKiBUaGVzZSBhcmUgdS1ib290IGdlbmVyaWMgcGFyYW1ldGVycyAqLworI2luY2x1ZGUgPGNtZF9jb25mZGVmcy5oPgorCisjZGVmaW5lIENPTkZJR19aRVJPX0JPT1RERUxBWV9DSEVDSwkvKiBjaGVjayBmb3Iga2V5cHJlc3Mgb24gYm9vdGRlbGF5PT0wICovCisjZGVmaW5lIENPTkZJR19CT09UREVMQVkJNQkvKiBhdXRvYm9vdCBhZnRlciA1IHNlY29uZHMJKi8KKworLyoKKyAqIE1pc2NlbGxhbmVvdXMgY29uZmlndXJhYmxlIG9wdGlvbnMKKyAqLworI2RlZmluZSBDRkdfTE9OR0hFTFAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogdW5kZWYgdG8gc2F2ZSBtZW1vcnkgICAgICAgICAqLworI2RlZmluZSBDRkdfUFJPTVBUICAgICAgICAgICAgICAiPT4gIiAgIC8qIE1vbml0b3IgQ29tbWFuZCBQcm9tcHQgICAgICAgKi8KKyNkZWZpbmUgQ0ZHX0NCU0laRSAgICAgICAgICAgICAgMjU2ICAgICAgICAgICAgIC8qIENvbnNvbGUgSS9PIEJ1ZmZlciBTaXplICAgICAgKi8KKyNkZWZpbmUgQ0ZHX1BCU0laRSAoQ0ZHX0NCU0laRStzaXplb2YoQ0ZHX1BST01QVCkrMTYpIC8qIFByaW50IEJ1ZmZlciBTaXplICovCisjZGVmaW5lIENGR19NQVhBUkdTICAgICAgICAgICAgIDE2ICAgICAgICAgICAgICAvKiBtYXggbnVtYmVyIG9mIGNvbW1hbmQgYXJncyAgICovCisjZGVmaW5lIENGR19CQVJHU0laRSAgICAgICAgICAgIENGR19DQlNJWkUgICAgICAvKiBCb290IEFyZ3VtZW50IEJ1ZmZlciBTaXplICAgICovCisKKyNkZWZpbmUgQ0ZHX01FTVRFU1RfU1RBUlQgICAgICAgMHgwMDQwMDAwMCAgICAgIC8qIG1lbXRlc3Qgd29ya3Mgb24gICAgICovCisjZGVmaW5lIENGR19NRU1URVNUX0VORCAgICAgICAgIDB4MDA4MDAwMDAgICAgICAvKiA0IC4uLiA4IE1CIGluIERSQU0gICAqLworI2RlZmluZSBDRkdfTE9BRF9BRERSICAgICAgICAgICAweDAwMDEwMDAwICAgICAgLyogZGVmYXVsdCBsb2FkIGFkZHJlc3MgKi8KKworI3VuZGVmICBDRkdfQ0xLU19JTl9IWiAgICAgICAgICAvKiBldmVyeXRoaW5nLCBpbmNsIGJvYXJkIGluZm8sIGluIEh6ICovCisjZGVmaW5lIENGR19IWgkJCTEwMDAJCS8qIGRlY3JlbWVudGVyIGZyZXE6IDEgbXMgdGlja3MgKi8KKwkJCQkJCS8qIHZhbGlkIGJhdWRyYXRlcyAqLworI2RlZmluZSBDRkdfQkFVRFJBVEVfVEFCTEUgICAgICB7IDk2MDAsIDE5MjAwLCAzODQwMCwgNTc2MDAsIDExNTIwMCB9CisKKy8qCisgKiBTdGFjayBzaXplcworICoKKyAqIFRoZSBzdGFjayBzaXplcyBhcmUgc2V0IHVwIGluIHN0YXJ0LlMgdXNpbmcgdGhlIHNldHRpbmdzIGJlbG93CisgKi8KKyNkZWZpbmUgQ09ORklHX1NUQUNLU0laRSAgICAgICAgKDEyOCoxMDI0KSAgICAgIC8qIHJlZ3VsYXIgc3RhY2sgKi8KKyNpZmRlZiBDT05GSUdfVVNFX0lSUQorI2RlZmluZSBDT05GSUdfU1RBQ0tTSVpFX0lSUSAgICAoNCoxMDI0KSAgICAgICAgLyogSVJRIHN0YWNrICovCisjZGVmaW5lIENPTkZJR19TVEFDS1NJWkVfRklRICAgICg0KjEwMjQpICAgICAgICAvKiBGSVEgc3RhY2sgKi8KKyNlbmRpZgorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKiBQbGF0Zm9ybS9Cb2FyZCBzcGVjaWZpYyBkZWZpbmVzIHN0YXJ0IGhlcmUuCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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